@danceiny/gotry 0.0.1-rc.13 → 0.0.1-rc.14
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 +119 -140
- package/README.zh-CN.md +233 -0
- package/bin/gotry-bootstrap.js +126 -0
- package/bin/gotry-inner.js +10 -3
- package/dist/capabilities/hbcli.js +42 -15
- package/dist/scripts/bootstrap-tests.js +56 -0
- package/dist/scripts/flyai-tests.js +95 -0
- package/dist/scripts/hbcli-tests.js +28 -3
- package/dist/src/index.js +8 -3
- package/package.json +2 -1
- package/ts/capabilities/hbcli.ts +51 -19
- package/ts/src/index.ts +17 -5
package/README.md
CHANGED
|
@@ -1,231 +1,210 @@
|
|
|
1
|
+
[English](README.md) | [简体中文](README.zh-CN.md)
|
|
2
|
+
|
|
1
3
|
# GoTry
|
|
2
4
|
|
|
3
5
|
[](https://github.com/Danceiny/gotry/actions/workflows/ci.yml)
|
|
4
6
|
|
|
5
|
-
>
|
|
6
|
-
>
|
|
7
|
+
> **Body and soul — more travel, less tourism.**
|
|
8
|
+
> *身体和灵魂,更多旅行,更少旅游。*
|
|
7
9
|
|
|
8
|
-
**GoTry
|
|
10
|
+
**GoTry is an AI travel agent for "departure to next departure."** You say where you want to go and why; it asks about your working hours and existing bookings, then hands you a **formally verified itinerary** — computed by a solver, not guessed by a model.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
| | |
|
|
13
|
+
|---|---|
|
|
14
|
+
| **Version** | `v0.0.1-rc.13+` (npm `latest`; [release notes](docs/release-notes.md)) |
|
|
15
|
+
| **Runtime** | DeepSeek Harness **0.1.2-alpha.1** (vendored; [upstream](https://github.com/deepseek-ai/DeepSeek-Harness)) · Z3 WASM · Cordis |
|
|
16
|
+
| **License** | **MIT** ([LICENSE](LICENSE)) |
|
|
17
|
+
| **Docs** | English (this file) · [简体中文 README](README.zh-CN.md) · deep engineering docs are Chinese-first ([docs/architecture.md](docs/architecture.md)) |
|
|
11
18
|
|
|
12
19
|
---
|
|
13
20
|
|
|
14
|
-
##
|
|
21
|
+
## ⚡ 30-second start
|
|
15
22
|
|
|
16
23
|
```bash
|
|
17
24
|
npx @danceiny/gotry web
|
|
18
|
-
#
|
|
19
|
-
# →
|
|
25
|
+
# First run creates .env: LLM_API_KEY=<DeepSeek key, or OpenAI-compatible key>
|
|
26
|
+
# → open http://127.0.0.1:3080 and chat: "I want three relaxing days in Dali"
|
|
20
27
|
```
|
|
21
28
|
|
|
22
|
-
|
|
|
29
|
+
| You want | Command |
|
|
23
30
|
|---|---|
|
|
24
|
-
| 🖥️
|
|
25
|
-
| 🤖
|
|
26
|
-
| 🛠️
|
|
27
|
-
|
|
28
|
-
- 前置:Node 22+;一个 LLM API key。零成本启动——dsh 运行时以 cordis patch 自动挂载,无额外配置。
|
|
29
|
-
- 例外提示:`:3080` 端口被占时先 `kill <PID>`;首启 6–15 秒属正常冷启动;异常退出会留证据到 `gotry-state/incidents.jsonl`(不静默)。
|
|
30
|
-
|
|
31
|
-
<details>
|
|
32
|
-
<summary>🛠️ 开发者:源码安装(仓内运行)</summary>
|
|
31
|
+
| 🖥️ Conversational planner (recommended) | `npx @danceiny/gotry web` → chat UI on :3080 |
|
|
32
|
+
| 🤖 Scripted / one-shot answer | `npx @danceiny/gotry "Two recovery days from Shenzhen, budget 3000"` |
|
|
33
|
+
| 🛠️ Developer: run from source | see [source install](#%EF%B8%8F-developer-source-install) below |
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
git clone https://github.com/Danceiny/gotry && cd gotry
|
|
36
|
-
cd ts/dsh-runtime && pnpm install && cd ../.. # ① vendored dsh 0.1.2-alpha.1(一次性)
|
|
37
|
-
cp .env.example .env # ② 填 LLM_API_KEY
|
|
38
|
-
./gotry web # ③ 仓内入口,同 npm 形态
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
| 入口 | 命令 | 什么时候用 |
|
|
42
|
-
|---|---|---|
|
|
43
|
-
| dsh Web 对话(推荐) | `./gotry web` | 持续多轮规划,看推理可视化 → :3080 |
|
|
44
|
-
| headless 一问一答 | `./gotry "一句任务"` | 脚本 / CI / 定向调试 → stdout |
|
|
45
|
-
| help | `./gotry help` | 三行帮助 |
|
|
46
|
-
|
|
47
|
-
为什么源码模式要先装 runtime:dsh 以 vendored tarball 进 git(`ts/dsh-runtime/`),npm 一键分发不打包它;源码检出读 `.ts` 源码,装完一次重复可用。
|
|
48
|
-
|
|
49
|
-
</details>
|
|
35
|
+
- Requires Node 22+ and one LLM API key. Zero-config startup — the dsh runtime is mounted automatically via a cordis patch.
|
|
50
36
|
|
|
51
37
|
---
|
|
52
38
|
|
|
53
|
-
## ✨
|
|
39
|
+
## ✨ What it does
|
|
54
40
|
|
|
55
|
-
GoTry
|
|
41
|
+
GoTry turns "I want to go somewhere" into "can I, how, and at what true cost":
|
|
56
42
|
|
|
57
|
-
|
|
|
43
|
+
| Stage | Who | Output |
|
|
58
44
|
|---|---|---|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
45
|
+
| **Motivation interview** | LLM | Mandatory questions: working window / booked resources / departure city |
|
|
46
|
+
| **Fact extraction** | LLM | Working hours semantics, leave semantics |
|
|
47
|
+
| **Feasibility verdict** | **Z3 solver** | Which destinations are feasible / infeasible, why, and the **smallest change that makes them feasible** |
|
|
48
|
+
| **Door-to-door true cost** | Solver | Real flight duration (incl. time zones) + early-wake penalty + transfer cost + arrival energy % |
|
|
49
|
+
| **Evidence chain** | Render layer | Every number tagged: `[骨架:openflights]` / `[实时API:flyai]` / `[静态包:估算]` |
|
|
64
50
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
> **Unlike a regular AI chat**, the LLM only translates and explains. **Decisions and arithmetic are computed by a Z3 solver**, not guessed.
|
|
51
|
+
**Unlike a regular AI chat**, the LLM only translates and explains. **Decisions and arithmetic are computed by a Z3 solver**, not guessed.
|
|
68
52
|
|
|
69
53
|
---
|
|
70
54
|
|
|
71
|
-
##
|
|
55
|
+
## 🚀 Quick start
|
|
72
56
|
|
|
73
|
-
|
|
57
|
+
### One-liner (npm, recommended)
|
|
74
58
|
|
|
59
|
+
```bash
|
|
60
|
+
npx @danceiny/gotry web
|
|
75
61
|
```
|
|
76
|
-
> 我想去洱海边发呆两三天,上海出发,预算 3000,年假别让我办公。
|
|
77
62
|
|
|
78
|
-
GoTry
|
|
79
|
-
• 窗口: 2 天(2026 年窗口) • 出发: 上海 • 预算: ¥3000 全含
|
|
80
|
-
• 动机: 休整 / [escape_rest: 0.7] • 还没订任何东西
|
|
63
|
+
That's it — the dsh chat UI on `:3080` with the GoTry persona mounted. First cold start is 6–15 s; if port `:3080` is taken, free it first; unexpected exits leave evidence in `gotry-state/incidents.jsonl` (nothing silent).
|
|
81
64
|
|
|
82
|
-
|
|
83
|
-
**大理·洱海: 现在不行** —— 2 天窗口装不下「至少 5 天的洱海休整」。
|
|
84
|
-
放宽方案: 行程延长到 5 天,约 ¥4950。★已放入「下一次出发」清单。
|
|
85
|
-
**千岛湖: 可行** (G7315 06:35 出发,¥996,到达精力 84%,有效休整 4.4h)
|
|
86
|
-
**太湖: 可行** (G101 09:00 出发,¥716,有效休整 4.6h)
|
|
87
|
-
建议: 千岛湖(意象匹配 80%)。
|
|
65
|
+
### Developer source install
|
|
88
66
|
|
|
89
|
-
|
|
90
|
-
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/Danceiny/gotry && cd gotry
|
|
69
|
+
cd ts/dsh-runtime && pnpm install && cd ../.. # ① vendored dsh 0.1.2-alpha.1 (one-off)
|
|
70
|
+
cp .env.example .env # ② set LLM_API_KEY
|
|
71
|
+
./gotry web # ③ in-repo entry, same UX
|
|
91
72
|
```
|
|
92
73
|
|
|
93
|
-
|
|
74
|
+
| Entry | Command | When |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| dsh Web chat (recommended) | `./gotry web` | multi-turn planning with visualized reasoning → :3080 |
|
|
77
|
+
| headless one-shot | `./gotry "one full task"` | scripts / CI / targeted debugging → stdout |
|
|
94
78
|
|
|
95
79
|
---
|
|
96
80
|
|
|
97
|
-
## 🧰 18
|
|
81
|
+
## 🧰 18 tools
|
|
98
82
|
|
|
99
|
-
|
|
|
83
|
+
| Group | Tool | What it does |
|
|
100
84
|
|---|---|---|
|
|
101
|
-
|
|
|
102
|
-
| | `gotry_session_search` |
|
|
103
|
-
| | `gotry_session_login` |
|
|
104
|
-
| | `gotry_weather_check` | Open-Meteo
|
|
105
|
-
| | `gotry_flight_verify` | OpenSky ADS-B
|
|
106
|
-
| | `gotry_skeleton_check` | OpenFlights 168
|
|
107
|
-
|
|
|
108
|
-
| | `gotry_anything_search` |
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
| | `gotry_wish_pool_add` / `gotry_wish_pool_list` |
|
|
112
|
-
| | `gotry_companion_save` · `gotry_trip_log` |
|
|
113
|
-
|
|
|
85
|
+
| **Realtime retrieval (OTA/official, read-only)** | `gotry_flyai_search` | Live flight/train/hotel quotes via the Fliggy official channel (masked hotel prices upstream; real prices on the jumpUrl page) |
|
|
86
|
+
| | `gotry_session_search` | Ctrip flights on the **user's own logged-in Chrome session** (consent-gated, physically read-only) |
|
|
87
|
+
| | `gotry_session_login` | Login bootstrap: auto-detects existing login first; otherwise opens the login entry in the user's Chrome (**zero terminal**) |
|
|
88
|
+
| | `gotry_weather_check` | Open-Meteo forecast ≤16 d + historical climate baseline |
|
|
89
|
+
| | `gotry_flight_verify` | OpenSky ADS-B live flight observation (three-valued) |
|
|
90
|
+
| | `gotry_skeleton_check` | OpenFlights 168-hub-pair connectivity (three-valued) |
|
|
91
|
+
| **Inventory & catalog** | `gotry_hotel_search` | hotel-byte realtime bridge, degrades to static pack (tagged) |
|
|
92
|
+
| | `gotry_anything_search` | mixed city/hotel/POI catalog (hotel-be Anything) |
|
|
93
|
+
| **Decision engine** | `gotry_feasibility_check` | Door-to-door true-cost feasibility (Z3), per-candidate verdicts |
|
|
94
|
+
| **Memory & reachability** | `gotry_motivation_save` | Persist motivation profile (evidence mandatory, anti-fabrication) |
|
|
95
|
+
| | `gotry_wish_pool_add` / `gotry_wish_pool_list` | "next departure" wish pool + 0..1 conditional recall |
|
|
96
|
+
| | `gotry_companion_save` · `gotry_trip_log` | companion profile / travel timeline |
|
|
97
|
+
| **General external** | `gotry_web_search` · `gotry_video_subtitle` · `gotry_github_search` · `gotry_agent_reach` | web / subtitles / GitHub / all-channel external info (via Agent-Reach) |
|
|
114
98
|
|
|
115
99
|
---
|
|
116
100
|
|
|
117
|
-
## 🔐
|
|
101
|
+
## 🔐 Account session: consent & privacy
|
|
118
102
|
|
|
119
|
-
|
|
103
|
+
The account session channel reads realtime hotel/flight data from **the user's own logged-in Chrome**, under four hard rules:
|
|
120
104
|
|
|
121
|
-
1.
|
|
122
|
-
2.
|
|
123
|
-
3.
|
|
124
|
-
4.
|
|
105
|
+
1. **Login happens on the external website.** GoTry never offers, fills, or collects any password / SMS code / cookie value. It only answers one boolean question: "does a login-ticket cookie exist" (reads cookie **names** only — zero values touched).
|
|
106
|
+
2. **Consent card, once per session.** The first account-session use pops a runtime approval card; approval holds for the session, a refusal revokes it for the session (no repeat prompting). Master switch `sessionAccess: ask|allow|off` at any time.
|
|
107
|
+
3. **Physically read-only.** A ReadGuard aborts all write requests at the network layer (ordering/payment is unreachable in transport); the agent never touches credentials or captchas — on a captcha it stops and hands control back.
|
|
108
|
+
4. **Never hijacks your browser.** Retrieval/login always open their own dedicated tab; the login page is brought to front and stays with you; routine test runs never open browser windows.
|
|
125
109
|
|
|
126
|
-
>
|
|
110
|
+
> One-time prerequisite: in your daily Chrome, open `chrome://inspect/#remote-debugging` and enable the switch (Chrome 144+). Without it the tools return `needs-attach` with instructions and spend nothing.
|
|
127
111
|
|
|
128
112
|
---
|
|
129
113
|
|
|
130
|
-
##
|
|
114
|
+
## 🎬 A conversation — Demo
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
> Two or three days staring at Erhai Lake, leaving from Shanghai, budget 3000, annual leave — no work.
|
|
118
|
+
|
|
119
|
+
GoTry: constraints captured —
|
|
120
|
+
• window: 2 days • departure: Shanghai • budget: ¥3000 all-in
|
|
121
|
+
• motivation: recovery [escape_rest: 0.7] • no bookings yet
|
|
122
|
+
|
|
123
|
+
Engine verdict:
|
|
124
|
+
**Erhai, Dali: not feasible now** — a 2-day window can't hold "at least 5 days of Erhai recovery".
|
|
125
|
+
Relax: extend to 5 days, ~¥4950. ★ saved to your "next departure" wish pool.
|
|
126
|
+
**Qiandao Lake: feasible** (G7315 06:35, ¥996, arrival energy 84%, effective rest 4.4h)
|
|
127
|
+
**Taihu Lake: feasible** (G101 09:00, ¥716, effective rest 4.6h)
|
|
128
|
+
Suggestion: Qiandao Lake (imagery match 80%).
|
|
129
|
+
|
|
130
|
+
[skeleton:openflights] ✓ SZX↔PVG verified [realtime:hbcli] Shanghai airports live
|
|
131
|
+
[static-pack:estimate] G7315/G7316 priced on Jul–Aug off-season rates
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 🏛️ Architecture
|
|
131
137
|
|
|
132
138
|
```
|
|
133
139
|
┌──────────────────────────────────────────────────────────────┐
|
|
134
|
-
│ L1
|
|
135
|
-
│ L2
|
|
136
|
-
│ L3
|
|
137
|
-
│ L4
|
|
138
|
-
│ L5
|
|
140
|
+
│ L1 chat-as-interface; gates are in-message choice cards │
|
|
141
|
+
│ L2 orchestration dsh runtime + GoTry plugin (ReAct); 18 tools│
|
|
142
|
+
│ L3 domain unified itinerary model + Z3 feasibility engine │
|
|
143
|
+
│ L4 data static packs + hotelbyte-cli bridge + OpenFlights │
|
|
144
|
+
│ L5 governance LoopX (objective / gates / evidence / quota) │
|
|
139
145
|
└──────────────────────────────────────────────────────────────┘
|
|
140
146
|
```
|
|
141
147
|
|
|
142
|
-
|
|
|
148
|
+
| Layer | Module | Role |
|
|
143
149
|
|---|---|---|
|
|
144
|
-
| L2 | `ts/src/index.ts`(dsh
|
|
145
|
-
| L3 | `ts/src/unified.ts` · `py/gotry_feasibility/` |
|
|
146
|
-
| L4 | `ts/capabilities/hbcli.ts` · `skeleton-check.ts` |
|
|
147
|
-
| L5 | loopx
|
|
150
|
+
| L2 | `ts/src/index.ts` (dsh plugin) | 18 tools, time-anchor & memory-brief variables; execute isolation + consent gate + process guards |
|
|
151
|
+
| L3 | `ts/src/unified.ts` · `py/gotry_feasibility/` | single solving entry (candidate enumeration + flight-chain Z3) |
|
|
152
|
+
| L4 | `ts/capabilities/hbcli.ts` · `skeleton-check.ts` | realtime inventory bridge + OpenFlights skeleton (three-valued semantics) |
|
|
153
|
+
| L5 | loopx governance | objective / gates / evidence / quota |
|
|
148
154
|
|
|
149
|
-
> 📖
|
|
155
|
+
> 📖 Full ADRs / evolution / debt ledger: [`docs/architecture.md`](docs/architecture.md) (Chinese — English versions planned for v0.1.0)
|
|
150
156
|
|
|
151
157
|
---
|
|
152
158
|
|
|
153
|
-
## ⚠️
|
|
159
|
+
## ⚠️ Status & limitations
|
|
154
160
|
|
|
155
|
-
|
|
161
|
+
**Ready (green, verifiable):**
|
|
156
162
|
|
|
157
|
-
- ✅ **Z3 WASM race
|
|
158
|
-
- ✅
|
|
159
|
-
- ✅
|
|
160
|
-
- ✅
|
|
161
|
-
-
|
|
163
|
+
- ✅ **Z3 WASM race fixed** (`z3-shared.ts` single instance + session-level mutex; run-all §30 concurrency regression gate)
|
|
164
|
+
- ✅ **Realtime flight/hotel/session retrieval** via the FlyAI official channel (flight/train/hotel; `GOTRY_REALTIME_PRICING=1` optionally overwrites priced legs in the solver)
|
|
165
|
+
- ✅ **English output for the deterministic solve layer** (`GOTRY_LOCALE=en`, zero missing keys)
|
|
166
|
+
- ✅ **Account session: consent gate + productized login + auto-detection** (see [🔐 Account session](#-account-session-consent--privacy))
|
|
167
|
+
- License MIT; legacy shell frontend removed (dsh web is the only product surface)
|
|
162
168
|
|
|
163
|
-
|
|
169
|
+
**Open (honest list):**
|
|
164
170
|
|
|
165
|
-
- ⏳ **M3 Exit
|
|
166
|
-
- ⏳
|
|
167
|
-
- ⏳
|
|
171
|
+
- ⏳ **M3 Exit not closed** — engineering & distribution ready, but real seed-user evidence (50–200 person cohort) not yet accumulated; synthetic fixtures prove contracts, not business pass
|
|
172
|
+
- ⏳ **Non-Chinese UI remnants** — the dsh web UI belongs to the host; tool result cards and persona dialogue localization await M4 calibration samples
|
|
173
|
+
- ⏳ **Ctrip-hotel / Meituan session adapters** — flight done; hotel session surfaces await real login-state backfill (next tick)
|
|
168
174
|
|
|
169
175
|
<details>
|
|
170
|
-
<summary>📖
|
|
176
|
+
<summary>📖 Full status ledger (transactional state / evidence contracts / milestone stance)</summary>
|
|
171
177
|
|
|
172
|
-
|
|
178
|
+
Transactional state ledger (ADR-15, `gotry_async_terminal.v1`: 4/4→`succeeded`/ledger `settled`/exit 0; non-4/4→`failed`/`failed`/exit 2; replaying the terminal state recomputes nothing); dual-form architecture freeze (ADR-16: one ledger semantics for local+Web, tenant_id first-class); session-data-plane #21 field fixture scorer, dual-source contract and waiting-attach no-spend are in deterministic regression, real sf-01..08 not yet accepted; milestone stance (2026-08-29): M3 engineering & distribution ready but real seed-user evidence not closed, M4 proceeds under founder authorization without constituting M3 Exit proof, M5/M6 only after their Entry gates — details in [`docs/roadmap.md`](docs/roadmap.md) and [`docs/architecture.md`](docs/architecture.md).
|
|
173
179
|
|
|
174
180
|
</details>
|
|
175
181
|
|
|
176
182
|
---
|
|
177
183
|
|
|
178
|
-
##
|
|
179
|
-
|
|
180
|
-
| 文档 | 适合谁 |
|
|
181
|
-
|---|---|
|
|
182
|
-
| [本 README](README.md) | **所有人**:是什么 · 怎么用 · 限制 |
|
|
183
|
-
| [`docs/architecture.md`](docs/architecture.md) | 工程师:分层 · ADR · 演进 · 债务 |
|
|
184
|
-
| [`docs/roadmap.md`](docs/roadmap.md) | 项目管理:M0–M6 与当前位置 |
|
|
185
|
-
| [`docs/user-guide.md`](docs/user-guide.md) | 终端用户:详细使用文档 |
|
|
186
|
-
| [`docs/gotry-product-design.md`](docs/gotry-product-design.md) | 产品:主循环 · 透明机制 · 全成本模型 |
|
|
187
|
-
| [`docs/gotry-master-outline.md`](docs/gotry-master-outline.md) | 决策者:工作分解 · 复用矩阵 |
|
|
188
|
-
| [`docs/kimi-postmortem.md`](docs/kimi-postmortem.md) | 所有人:真实 AI 旅行规划失败复盘(反面教材) |
|
|
189
|
-
| [`docs/release-notes.md`](docs/release-notes.md) | 历史:每个 tag 的发布闸勾稽 |
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## 🧪 跑测试 — Verify
|
|
184
|
+
## 🧪 Verify
|
|
194
185
|
|
|
195
186
|
```bash
|
|
196
187
|
./scripts/run-all-tests.sh
|
|
197
188
|
```
|
|
198
189
|
|
|
199
|
-
|
|
190
|
+
One-shot full-stack green (pure TS, no Python needed): golden engines · dialogue replay · cross-process async work-orders · plugin smoke · hbcli · process guards · weather · flights · Anything · probePoi · agent-reach · dual-path stability · time-awareness eval · memory domain · **Z3 race (§30) · realtime pricing (§31) · i18n catalog (§32) · M3 cohort evidence contract (§33) · M4 value evidence contract (§34)**.
|
|
200
191
|
|
|
201
192
|
---
|
|
202
193
|
|
|
203
|
-
## 🤝
|
|
204
|
-
|
|
205
|
-
> *PR-based flow: branch off the latest `main`, full suite green, open a Pull Request — `main` never takes direct pushes; merge after review. Full guide: [CONTRIBUTING.md](CONTRIBUTING.md).*
|
|
194
|
+
## 🤝 Contributing
|
|
206
195
|
|
|
207
|
-
|
|
196
|
+
> *PR-based flow: branch off the latest `main`, full suite green, open a Pull Request — `main` never takes direct pushes. Full guide: [CONTRIBUTING.md](CONTRIBUTING.md).*
|
|
208
197
|
|
|
209
|
-
-
|
|
210
|
-
- Bug / 功能建议:[issue 模板](.github/ISSUE_TEMPLATE/bug_report.yml)(搜过既有 issue 再提)
|
|
211
|
-
- 行为或架构改动先立 ADR(`docs/architecture.md` §8);多 agent 协作契约见 [`AGENTS.md`](AGENTS.md)
|
|
198
|
+
Standard open-source flow: branch off latest `main` (`feat/ · fix/ · docs/ · chore/`), full suite green locally, open a PR; CI (Node 22/24, typecheck + all suites) plus maintainer review, then squash-merge. **Red tests never merge.**
|
|
212
199
|
|
|
213
200
|
---
|
|
214
201
|
|
|
215
202
|
## 📜 License
|
|
216
203
|
|
|
217
|
-
**MIT**(2026-08-23
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## 🌐 中英版 — Locales
|
|
222
|
-
|
|
223
|
-
- **English section summaries** are inline above (italic blockquotes).
|
|
224
|
-
- 本 README 主语言是中文,面向中国出境首发种子用户群。
|
|
225
|
-
- 完整英文版 README 计划在 v0.1.0 同步。
|
|
204
|
+
**MIT** (2026-08-23) — same as upstream dsh. See [LICENSE](LICENSE).
|
|
226
205
|
|
|
227
206
|
---
|
|
228
207
|
|
|
229
208
|
**Built with**: DeepSeek Harness 0.1.2-alpha.1 (vendored) · Cordis · Z3 (WASM) · loopx (pipx) · hotelbyte-cli · Agent-Reach v1.5.0 (`.venv/`) · OpenFlights · TypeScript
|
|
230
209
|
|
|
231
|
-
**Last verified against `v0.0.1-rc.
|
|
210
|
+
**Last verified against `v0.0.1-rc.14` (2026-08-29)** — full-stack regression green §1-§34 (release flow: `scripts/publish-npm.sh`).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# GoTry
|
|
2
|
+
|
|
3
|
+
[English](README.md) | [简体中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/Danceiny/gotry/actions/workflows/ci.yml)
|
|
6
|
+
|
|
7
|
+
> **身体和灵魂,更多旅行,更少旅游。**
|
|
8
|
+
> *Body and soul — more travel, less tourism.*
|
|
9
|
+
|
|
10
|
+
**GoTry 是「从出发到下一次出发」的 AI 旅行 Agent**:你用一句话说想去哪、为什么想出发;它先问清楚你的工作时间和已订资源,再用**数学求解器**给你一份经过验证的行程方案。
|
|
11
|
+
|
|
12
|
+
**GoTry is an AI travel agent for departure-to-next-departure.** Tell it where you want to go and why. It asks what's missing, then hands you a **formally verified itinerary** — not vibes.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 🚀 30 秒上手
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @danceiny/gotry web
|
|
20
|
+
# 首跑会提示建 .env:LLM_API_KEY=<DeepSeek key 或 OpenAI 兼容 key>
|
|
21
|
+
# → 浏览器打开 http://127.0.0.1:3080,像聊天一样说「我想去大理三天」
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| 你想要的 | 命令 |
|
|
25
|
+
|---|---|
|
|
26
|
+
| 🖥️ 对话规划(推荐) | `npx @danceiny/gotry web` → :3080 对话界面 |
|
|
27
|
+
| 🤖 脚本/一次性问答 | `npx @danceiny/gotry "我想从深圳休整两天,预算 3000"` |
|
|
28
|
+
| 🛠️ 开发者:仓内运行 | 见下方[源码安装](#-快速开始) |
|
|
29
|
+
|
|
30
|
+
- 前置:Node 22+;一个 LLM API key。零成本启动——dsh 运行时以 cordis patch 自动挂载,无额外配置。
|
|
31
|
+
- 例外提示:`:3080` 端口被占时先 `kill <PID>`;首启 6–15 秒属正常冷启动;异常退出会留证据到 `gotry-state/incidents.jsonl`(不静默)。
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>🛠️ 开发者:源码安装(仓内运行)</summary>
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/Danceiny/gotry && cd gotry
|
|
38
|
+
cd ts/dsh-runtime && pnpm install && cd ../.. # ① vendored dsh 0.1.2-alpha.1(一次性)
|
|
39
|
+
cp .env.example .env # ② 填 LLM_API_KEY
|
|
40
|
+
./gotry web # ③ 仓内入口,同 npm 形态
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| 入口 | 命令 | 什么时候用 |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| dsh Web 对话(推荐) | `./gotry web` | 持续多轮规划,看推理可视化 → :3080 |
|
|
46
|
+
| headless 一问一答 | `./gotry "一句任务"` | 脚本 / CI / 定向调试 → stdout |
|
|
47
|
+
| help | `./gotry help` | 三行帮助 |
|
|
48
|
+
|
|
49
|
+
为什么源码模式要先装 runtime:dsh 以 vendored tarball 进 git(`ts/dsh-runtime/`),npm 一键分发不打包它;源码检出读 `.ts` 源码,装完一次重复可用。
|
|
50
|
+
|
|
51
|
+
</details>
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## ✨ 它做什么 — What it does
|
|
56
|
+
|
|
57
|
+
GoTry 把「想去哪」变成「能不能、怎么去」:
|
|
58
|
+
|
|
59
|
+
| 阶段 | 由谁做 | 给你什么 |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| **动机访谈** | LLM | 必问项:工作窗口 / 已订资源 / 出发城市 |
|
|
62
|
+
| **事实抽取** | LLM | 工作窗口生效 + 休假语义识别 |
|
|
63
|
+
| **可行性判定** | **Z3 求解器** | 哪些候选可行、哪些不可行、为什么、**最小改动让它可行** |
|
|
64
|
+
| **门到门全成本** | 求解器 | 真实飞行时长(含时差)+ 醒来起夜惩罚 + 接驳代价 + 到达精力 % |
|
|
65
|
+
| **证据链** | 渲染层 | 每个数字带标签:`[骨架:openflights]` / `[实时API:flyai]` / `[静态包:估算]` |
|
|
66
|
+
|
|
67
|
+
**不像普通 AI 聊天**——LLM 只做理解和解释,**判定与算术是数学求解器**算的。
|
|
68
|
+
|
|
69
|
+
> **Unlike a regular AI chat**, the LLM only translates and explains. **Decisions and arithmetic are computed by a Z3 solver**, not guessed.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 🎬 一段对话 — Demo
|
|
74
|
+
|
|
75
|
+
输入 → 引擎判定 → 输出(真实输出,milliseconds 保留原味):
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
> 我想去洱海边发呆两三天,上海出发,预算 3000,年假别让我办公。
|
|
79
|
+
|
|
80
|
+
GoTry: 收到。先把约束记下来——
|
|
81
|
+
• 窗口: 2 天(2026 年窗口) • 出发: 上海 • 预算: ¥3000 全含
|
|
82
|
+
• 动机: 休整 / [escape_rest: 0.7] • 还没订任何东西
|
|
83
|
+
|
|
84
|
+
引擎判定:
|
|
85
|
+
**大理·洱海: 现在不行** —— 2 天窗口装不下「至少 5 天的洱海休整」。
|
|
86
|
+
放宽方案: 行程延长到 5 天,约 ¥4950。★已放入「下一次出发」清单。
|
|
87
|
+
**千岛湖: 可行** (G7315 06:35 出发,¥996,到达精力 84%,有效休整 4.4h)
|
|
88
|
+
**太湖: 可行** (G101 09:00 出发,¥716,有效休整 4.6h)
|
|
89
|
+
建议: 千岛湖(意象匹配 80%)。
|
|
90
|
+
|
|
91
|
+
[骨架:openflights] ✓ SZX↔PVG 已校验 [实时API:hbcli] 上海机场在跑
|
|
92
|
+
[静态包:估算] G7315/G7316 价格按 7-8 月淡季估算
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
> **Brief English summary**: input → engine verdicts (feasibility + whole-cost) → recommendation + wish-pool entry for infeasible candidates. Every numeric carries an evidence tag.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 🧰 18 个工具 — Tools
|
|
100
|
+
|
|
101
|
+
| 组 | 工具 | 干什么 |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| **实时检索(OTA/官方只读)** | `gotry_flyai_search` | 机票/火车/酒店实时报价(飞猪官方通道;酒店价格为上游打码展示,真实价以 jumpUrl 为准) |
|
|
104
|
+
| | `gotry_session_search` | 在**用户本人登录态**里查携程机票(授权后,只读) |
|
|
105
|
+
| | `gotry_session_login` | 登录引导:自动检测已登录与否,未登录才在用户 Chrome 弹登录入口(**零终端**) |
|
|
106
|
+
| | `gotry_weather_check` | Open-Meteo 预报≤16 天 + 历史气候基线 |
|
|
107
|
+
| | `gotry_flight_verify` | OpenSky ADS-B 航班实时观测(三值) |
|
|
108
|
+
| | `gotry_skeleton_check` | OpenFlights 168 对枢纽通航性(三值) |
|
|
109
|
+
| **库存与目录** | `gotry_hotel_search` | hotel-byte 实时桥,降级静态包(证据标注) |
|
|
110
|
+
| | `gotry_anything_search` | 城市/酒店/地标混合目录(hotel-be Anything) |
|
|
111
|
+
| **判定引擎** | `gotry_feasibility_check` | 门到门真成本可行性(Z3),逐候选判定 |
|
|
112
|
+
| **记忆与触达** | `gotry_motivation_save` | 动机画像落盘(evidence 强制,反幻觉) |
|
|
113
|
+
| | `gotry_wish_pool_add` / `gotry_wish_pool_list` | 「下一次出发」愿望池 + 0..1 条件召回 |
|
|
114
|
+
| | `gotry_companion_save` · `gotry_trip_log` | 同行人档案 / 旅行时间线 |
|
|
115
|
+
| **通用外部** | `gotry_web_search` · `gotry_video_subtitle` · `gotry_github_search` · `gotry_agent_reach` | 网页/字幕/GitHub/全渠道外部信息(经 Agent-Reach) |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 🔐 账号会话:授权与隐私 — Account consent
|
|
120
|
+
|
|
121
|
+
会话检索使用**你本人已登录的 Chrome**读取酒店/机票实时数据,为此立了四条 hard 规则:
|
|
122
|
+
|
|
123
|
+
1. **登录在外部网站完成** —— gotry 从不提供、不代填、不收集任何密码/验证码/cookie 值。它只回答一个布尔问题:"登录票据 cookie 存在吗"(只读**名字**,0 值过手)。
|
|
124
|
+
2. **授权卡,每会话一次** —— 首次动用账号会话会弹运行时审批卡;批准后会话内记住,拒绝即本会话吊销,不再打扰。总闸 `sessionAccess: ask|allow|off` 随时可关。
|
|
125
|
+
3. **物理只读** —— ReadGuard 在网络层中止一切写请求(下单/支付在传输层不可达),agent 永不接触凭证与验证码;遇到验证码立即停,交还给你。
|
|
126
|
+
4. **绝不劫持你的浏览器** —— 检索/登录只开自己的独立标签页,登录页置前台、留在你那;例行动测试永不自动开浏览器窗。
|
|
127
|
+
|
|
128
|
+
> 前置(一次性):日常 Chrome 打开 `chrome://inspect/#remote-debugging` 打开开关(Chrome 144+),并保持 Chrome 在线。未开启时工具返回 `needs-attach` 并给出指引,不消耗执行配额。
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 🏛️ 架构 — Architecture
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
136
|
+
│ L1 对话即界面 chat-as-UI; gates 是消息内选择题 │
|
|
137
|
+
│ L2 编排 dsh 运行时 + GoTry 插件(ReAct);18 个工具 │
|
|
138
|
+
│ L3 领域 统一行程模型 + Z3 可行性引擎(枚举/Z3 双形态) │
|
|
139
|
+
│ L4 数据 静态数据包 + hotelbyte-cli 实时桥 + OpenFlights 骨架 │
|
|
140
|
+
│ L5 治理 LoopX(objective / gates / evidence / quota) │
|
|
141
|
+
└──────────────────────────────────────────────────────────────┘
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
| 层 | 模块 | 角色 |
|
|
145
|
+
|---|---|---|
|
|
146
|
+
| L2 | `ts/src/index.ts`(dsh 插件) | 注册 18 工具,挂时间锚点/记忆 brief 变量;execute 异常隔离 + 授权闸 + 进程护栏 |
|
|
147
|
+
| L3 | `ts/src/unified.ts` · `py/gotry_feasibility/` | 唯一求解入口(候选枚举 + 航班链 Z3) |
|
|
148
|
+
| L4 | `ts/capabilities/hbcli.ts` · `skeleton-check.ts` | 实时库存桥 + OpenFlights 骨架(三值语义) |
|
|
149
|
+
| L5 | loopx 治理面 | objective / gates / evidence / quota |
|
|
150
|
+
|
|
151
|
+
> 📖 完整 ADR / 演进 / 债务清单: [`docs/architecture.md`](docs/architecture.md)
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## ⚠️ 状态与限制 — Status & limitations
|
|
156
|
+
|
|
157
|
+
**已就绪(全绿可验)**:
|
|
158
|
+
|
|
159
|
+
- ✅ **Z3 WASM race 已根治**(`z3-shared.ts` 单实例+会话级互斥;run-all §30 并发回归闸)
|
|
160
|
+
- ✅ **实时机票/酒店/会话检索**已接入:FlyAI 官方通道(机/火/酒;`GOTRY_REALTIME_PRICING=1` 可选把实时票价覆写进求解)
|
|
161
|
+
- ✅ **英文面(工程层)**:`GOTRY_LOCALE=en` 一键切换,en 零缺键,金标准行为不变
|
|
162
|
+
- ✅ **账号会话:授权闸 + 登录产品化 + 自动检测**(见上方 [🔐 账号会话](#-账号会话授权与隐私--account-consent))
|
|
163
|
+
- ✅ License MIT;薄壳遗留已删除(dsh web 唯一产品面)
|
|
164
|
+
|
|
165
|
+
**未收口(诚实清单)**:
|
|
166
|
+
|
|
167
|
+
- ⏳ **M3 Exit 未关闭** —— 工程与分发面就绪,但真实种子用户 evidence(50–200 人 cohort)未积累;合成 fixture 只证明合同不证明 business pass
|
|
168
|
+
- ⏳ **中文之外的界面残余** —— dsh web 界面属宿主;工具结果卡与人格对话面的英文校准件挂 M4 校准样本
|
|
169
|
+
- ⏳ **携程酒店/美团会话适配器** —— 机票已通,酒店会话面等登录态实测回填(下一 tick)
|
|
170
|
+
|
|
171
|
+
<details>
|
|
172
|
+
<summary>📖 展开完整状态表(账本/证据合同/里程碑口径)</summary>
|
|
173
|
+
|
|
174
|
+
事务化状态账本(ADR-15,`gotry_async_terminal.v1`:4/4→`succeeded`/ledger `settled`/exit 0,非 4/4→`failed`/`failed`/exit 2,终态复诵零重算);双形态架构冻结(ADR-16:本地+Web 一套账本语义,tenant_id 一等字段);会话数据面 #21 的字段 fixture scorer、双源合同与 waiting-attach no-spend 已进确定性回归,真实 sf-01..08 尚未验收;里程碑口径(2026-08-29):M3 工程与分发面已就绪但真实种子用户 evidence 未收口,M4 由 founder 授权并行推进不构成 M3 Exit 证明,M5/M6 仅在各自 Entry gate 满足后启动——细则见 [`docs/roadmap.md`](docs/roadmap.md) 与 [`docs/architecture.md`](docs/architecture.md)。
|
|
175
|
+
|
|
176
|
+
</details>
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## 📚 文档 — Docs
|
|
181
|
+
|
|
182
|
+
| 文档 | 适合谁 |
|
|
183
|
+
|---|---|
|
|
184
|
+
| [本 README](README.md) | **所有人**:是什么 · 怎么用 · 限制 |
|
|
185
|
+
| [`docs/architecture.md`](docs/architecture.md) | 工程师:分层 · ADR · 演进 · 债务 |
|
|
186
|
+
| [`docs/roadmap.md`](docs/roadmap.md) | 项目管理:M0–M6 与当前位置 |
|
|
187
|
+
| [`docs/user-guide.md`](docs/user-guide.md) | 终端用户:详细使用文档 |
|
|
188
|
+
| [`docs/gotry-product-design.md`](docs/gotry-product-design.md) | 产品:主循环 · 透明机制 · 全成本模型 |
|
|
189
|
+
| [`docs/gotry-master-outline.md`](docs/gotry-master-outline.md) | 决策者:工作分解 · 复用矩阵 |
|
|
190
|
+
| [`docs/kimi-postmortem.md`](docs/kimi-postmortem.md) | 所有人:真实 AI 旅行规划失败复盘(反面教材) |
|
|
191
|
+
| [`docs/release-notes.md`](docs/release-notes.md) | 历史:每个 tag 的发布闸勾稽 |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🧪 跑测试 — Verify
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
./scripts/run-all-tests.sh
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
全栈一次性绿(纯 TS,无 Python 依赖):engine/journey/unified 金标准 · 对话重放 · 异步工单跨进程 · 插件 smoke · hbcli · 进程护栏(含工具异常隔离)· 天气 · 航班 · Anything · probePoi · agent-reach(web/deep/wrapper)· 双路径稳定性 · 时间感评测(锚点卡/槽位过期校验/评分器/mock 回放;真模型巡检 `time-eval-tests.ts --real`)· 记忆域(动机合并守门/效用 sidecar/只读指标投影)· **Z3 并发竞态(§30)· 实时票价桥(§31)· i18n 目录(§32)· M3 cohort 证据合同(§33)· M4 价值证据合同(§34)**。
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 🤝 参与开发 — Contributing
|
|
206
|
+
|
|
207
|
+
> *PR-based flow: branch off the latest `main`, full suite green, open a Pull Request — `main` never takes direct pushes; merge after review. Full guide: [CONTRIBUTING.md](CONTRIBUTING.md).*
|
|
208
|
+
|
|
209
|
+
标准开源流程:**`main` 不直接推**——从最新 `main` 切出 `feat/ · fix/ · docs/ · chore/` 分支,本地全栈绿后开 Pull Request,CI(Node 22/24,typecheck + 全部套件)与维护者 review 双绿后 squash 合入。**测试红着不许合。**
|
|
210
|
+
|
|
211
|
+
- 完整贡献指南(环境搭建 · 测试 · 分支与提交约定 · PR 流程): **[CONTRIBUTING.md](CONTRIBUTING.md)**
|
|
212
|
+
- Bug / 功能建议:[issue 模板](.github/ISSUE_TEMPLATE/bug_report.yml)(搜过既有 issue 再提)
|
|
213
|
+
- 行为或架构改动先立 ADR(`docs/architecture.md` §8);多 agent 协作契约见 [`AGENTS.md`](AGENTS.md)
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 📜 License
|
|
218
|
+
|
|
219
|
+
**MIT**(2026-08-23 落定)。与上游 dsh(MIT)/ loopx 一致——宽松、可商用、可闭源分叉。文本见 [LICENSE](LICENSE)。
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🌐 中英版 — Locales
|
|
224
|
+
|
|
225
|
+
- 本文件(main)**英文版独立成文**:[README.md](README.md)——两文件各自完整,常见开源双语布局。
|
|
226
|
+
- 深 README(中文)面向中国出境首发种子用户群;英文版是它的完整镜像(不含深度工程文档)。
|
|
227
|
+
- `docs/` 深度工程文档当前中文先行,英文版计划 v0.1.0 同步。
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
**Built with**: DeepSeek Harness 0.1.2-alpha.1 (vendored) · Cordis · Z3 (WASM) · loopx (pipx) · hotelbyte-cli · Agent-Reach v1.5.0 (`.venv/`) · OpenFlights · TypeScript
|
|
232
|
+
|
|
233
|
+
**Last verified against `v0.0.1-rc.14`(2026-08-29)** — 全栈回归全绿 §1-§34(发布流程见 `scripts/publish-npm.sh`)。
|