@danceiny/gotry 0.0.1-rc.13 → 0.0.1-rc.15
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 +121 -140
- package/README.zh-CN.md +235 -0
- package/bin/gotry-bootstrap.js +165 -0
- package/bin/gotry-inner.js +10 -3
- package/dist/capabilities/artifacts.js +217 -0
- package/dist/capabilities/hbcli.js +42 -15
- package/dist/scripts/booking-saga-tests.js +187 -0
- package/dist/scripts/bootstrap-tests.js +66 -0
- package/dist/scripts/flyai-tests.js +95 -0
- package/dist/scripts/hbcli-tests.js +28 -3
- package/dist/scripts/nightly-evidence-tests.js +123 -0
- package/dist/scripts/nightly-evidence.js +233 -0
- package/dist/scripts/smoke.js +83 -0
- package/dist/src/booking-saga.js +153 -0
- package/dist/src/dsh-llm.js +30 -6
- package/dist/src/index.js +141 -3
- package/package.json +5 -2
- package/ts/capabilities/artifacts.ts +235 -0
- package/ts/capabilities/hbcli.ts +51 -19
- package/ts/src/booking-saga.ts +133 -0
- package/ts/src/dsh-llm.ts +40 -3
- package/ts/src/index.ts +145 -25
package/README.md
CHANGED
|
@@ -1,231 +1,212 @@
|
|
|
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>
|
|
33
|
-
|
|
34
|
-
```bash
|
|
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` 源码,装完一次重复可用。
|
|
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 |
|
|
48
34
|
|
|
49
|
-
|
|
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 carries a **source tag**: `[骨架:openflights]` = route existence verified against the public route database; `[实时API:flyai]` = pulled live from an API seconds ago; `[静态包:估算]` = a researched estimate (**not realtime — verify before booking**). On degradation the tag switches honestly — an estimate never poses as realtime |
|
|
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
|
-
## 🧰
|
|
81
|
+
## 🧰 20 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
|
+
| **Artifacts** | `gotry_artifacts_list` / `gotry_artifacts_read` | Discover & view generated artifacts (async deliverables + working-dir markdown) as a line-numbered file view (read-only) |
|
|
98
|
+
| **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
99
|
|
|
115
100
|
---
|
|
116
101
|
|
|
117
|
-
## 🔐
|
|
102
|
+
## 🔐 Account session: consent & privacy
|
|
118
103
|
|
|
119
|
-
|
|
104
|
+
The account session channel reads realtime hotel/flight data from **the user's own logged-in Chrome**, under four hard rules:
|
|
120
105
|
|
|
121
|
-
1.
|
|
122
|
-
2.
|
|
123
|
-
3.
|
|
124
|
-
4.
|
|
106
|
+
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).
|
|
107
|
+
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.
|
|
108
|
+
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.
|
|
109
|
+
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
110
|
|
|
126
|
-
>
|
|
111
|
+
> 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
112
|
|
|
128
113
|
---
|
|
129
114
|
|
|
130
|
-
##
|
|
115
|
+
## 🎬 A conversation — Demo
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
> Two or three days staring at Erhai Lake, leaving from Shanghai, budget 3000, annual leave — no work.
|
|
119
|
+
|
|
120
|
+
GoTry: constraints captured —
|
|
121
|
+
• window: 2 days • departure: Shanghai • budget: ¥3000 all-in
|
|
122
|
+
• motivation: recovery [escape_rest: 0.7] • no bookings yet
|
|
123
|
+
|
|
124
|
+
Engine verdict:
|
|
125
|
+
**Erhai, Dali: not feasible now** — a 2-day window can't hold "at least 5 days of Erhai recovery".
|
|
126
|
+
Relax: extend to 5 days, ~¥4950. ★ saved to your "next departure" wish pool.
|
|
127
|
+
**Qiandao Lake: feasible** (G7315 06:35, ¥996, arrival energy 84%, effective rest 4.4h)
|
|
128
|
+
**Taihu Lake: feasible** (G101 09:00, ¥716, effective rest 4.6h)
|
|
129
|
+
Suggestion: Qiandao Lake (imagery match 80%).
|
|
130
|
+
|
|
131
|
+
[skeleton:openflights] ✓ SZX↔PVG verified [realtime:hbcli] Shanghai airports live
|
|
132
|
+
[static-pack:estimate] G7315/G7316 priced on Jul–Aug off-season rates
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
> Tag guide: `[骨架:openflights]` means "this route can be flown" was verified against the public route database; `[实时API:*]` marks data pulled live seconds ago; `[静态包:估算]` flags an off-season estimate — **verify before booking**. Tags are attached by the render layer, never by the model.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🏛️ Architecture
|
|
131
140
|
|
|
132
141
|
```
|
|
133
142
|
┌──────────────────────────────────────────────────────────────┐
|
|
134
|
-
│ L1
|
|
135
|
-
│ L2
|
|
136
|
-
│ L3
|
|
137
|
-
│ L4
|
|
138
|
-
│ L5
|
|
143
|
+
│ L1 chat-as-interface; gates are in-message choice cards │
|
|
144
|
+
│ L2 orchestration dsh runtime + GoTry plugin (ReAct); 20 tools│
|
|
145
|
+
│ L3 domain unified itinerary model + Z3 feasibility engine │
|
|
146
|
+
│ L4 data static packs + hotelbyte-cli bridge + OpenFlights │
|
|
147
|
+
│ L5 governance LoopX (objective / gates / evidence / quota) │
|
|
139
148
|
└──────────────────────────────────────────────────────────────┘
|
|
140
149
|
```
|
|
141
150
|
|
|
142
|
-
|
|
|
151
|
+
| Layer | Module | Role |
|
|
143
152
|
|---|---|---|
|
|
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
|
|
153
|
+
| L2 | `ts/src/index.ts` (dsh plugin) | 20 tools, time-anchor & memory-brief variables; execute isolation + consent gate + process guards |
|
|
154
|
+
| L3 | `ts/src/unified.ts` · `py/gotry_feasibility/` | single solving entry (candidate enumeration + flight-chain Z3) |
|
|
155
|
+
| L4 | `ts/capabilities/effect.ts` · `hbcli.ts` · `skeleton-check.ts` | effect interpreter (backoff retry / circuit breaker / mock interpreter, issue #16) + realtime inventory bridge + OpenFlights skeleton (three-valued semantics) |
|
|
156
|
+
| L5 | loopx governance | objective / gates / evidence / quota |
|
|
148
157
|
|
|
149
|
-
> 📖
|
|
158
|
+
> 📖 Full ADRs / evolution / debt ledger: [`docs/architecture.md`](docs/architecture.md) (Chinese — English versions planned for v0.1.0)
|
|
150
159
|
|
|
151
160
|
---
|
|
152
161
|
|
|
153
|
-
## ⚠️
|
|
162
|
+
## ⚠️ Status & limitations
|
|
154
163
|
|
|
155
|
-
|
|
164
|
+
**Working today** (full-stack regression §1–§34 green; every item has deterministic tests):
|
|
156
165
|
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
- ✅ License MIT;薄壳遗留已删除(dsh web 唯一产品面)
|
|
166
|
+
- **Z3 solving engine** — feasibility verdicts + door-to-door whole-cost; the historical concurrency race is fixed (§30 regression gate)
|
|
167
|
+
- **Realtime retrieval** — flight/train/hotel (Fliggy official channel), destination/hotel catalogs, weather, live flight observation, route connectivity; realtime prices can overwrite solver prices (`GOTRY_REALTIME_PRICING=1`)
|
|
168
|
+
- **Account session search** — Ctrip flights on your own logged-in Chrome; consent & privacy rules above (see 🔐 **Account session: consent & privacy**)
|
|
169
|
+
- **Memory & reachability** — motivation profile / wish pool / companions / travel timeline; English output via `GOTRY_LOCALE=en`
|
|
162
170
|
|
|
163
|
-
|
|
171
|
+
**Open limitations** (as of 2026-08-29, honest list):
|
|
164
172
|
|
|
165
|
-
- ⏳ **M3 Exit
|
|
166
|
-
- ⏳
|
|
167
|
-
- ⏳
|
|
173
|
+
- ⏳ **M3 Exit not closed** — engineering & distribution ready, but real seed-user evidence (50–200 person cohort) not yet accumulated; automated tests prove contracts and formulas, not business pass
|
|
174
|
+
- ⏳ **Ctrip-hotel / Meituan logged-in adapters** — flights done; hotel session surfaces await real login-state backfill (next tick)
|
|
175
|
+
- ⏳ **Interface language** — English currently covers the deterministic solve-output layer only; the dsh host UI and dialogue surface belong to the host / calibration samples
|
|
168
176
|
|
|
169
177
|
<details>
|
|
170
|
-
<summary>📖
|
|
178
|
+
<summary>📖 Deeper engineering state (ledger contracts / evidence contracts / milestone stance)</summary>
|
|
171
179
|
|
|
172
|
-
|
|
180
|
+
The authoritative state lives in the docs, not this README: transactional state ledger (ADR-15) + dual-form freeze (ADR-16: one ledger semantics for local+web); the M3 real-cohort evidence contract stands (fixtures don't count toward Exit; 50–200 real samples open the gate); the M4 paired-cohort value evidence contract (run-all §34 — synthetic data is never Exit evidence); async work-order terminal contract (`gotry_async_terminal.v1`: 4/4 → succeeded / ledger settled / exit 0). Details: [`docs/roadmap.md`](docs/roadmap.md) / [`docs/architecture.md`](docs/architecture.md) §1 and issues #19–#22.
|
|
173
181
|
|
|
174
182
|
</details>
|
|
175
183
|
|
|
176
184
|
---
|
|
177
185
|
|
|
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
|
|
186
|
+
## 🧪 Verify
|
|
194
187
|
|
|
195
188
|
```bash
|
|
196
189
|
./scripts/run-all-tests.sh
|
|
197
190
|
```
|
|
198
191
|
|
|
199
|
-
|
|
192
|
+
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) · M3 nightly evidence producer contract (§35)**.
|
|
200
193
|
|
|
201
194
|
---
|
|
202
195
|
|
|
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).*
|
|
196
|
+
## 🤝 Contributing
|
|
206
197
|
|
|
207
|
-
|
|
198
|
+
> *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
199
|
|
|
209
|
-
-
|
|
210
|
-
- Bug / 功能建议:[issue 模板](.github/ISSUE_TEMPLATE/bug_report.yml)(搜过既有 issue 再提)
|
|
211
|
-
- 行为或架构改动先立 ADR(`docs/architecture.md` §8);多 agent 协作契约见 [`AGENTS.md`](AGENTS.md)
|
|
200
|
+
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
201
|
|
|
213
202
|
---
|
|
214
203
|
|
|
215
204
|
## 📜 License
|
|
216
205
|
|
|
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 同步。
|
|
206
|
+
**MIT** (2026-08-23) — same as upstream dsh. See [LICENSE](LICENSE).
|
|
226
207
|
|
|
227
208
|
---
|
|
228
209
|
|
|
229
210
|
**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
211
|
|
|
231
|
-
**Last verified against `v0.0.1-rc.
|
|
212
|
+
**Last verified against `v0.0.1-rc.15` (2026-08-29)** — full-stack regression green §1-§36 (release flow: `scripts/publish-npm.sh`).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
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
|
+
> 标签导读:`[骨架:openflights]` 说的是"这条航线能飞"已被公开航线数据校验;`[实时API:*]` 说的是刚从实时接口拉回的当下数据;`[静态包:估算]` 提醒价格是淡季档估算——**订前核实**。
|
|
96
|
+
|
|
97
|
+
> **Brief English summary**: input → engine verdicts (feasibility + whole-cost) → recommendation + wish-pool entry for infeasible candidates. Every numeric carries an evidence tag. See the 证据链 row above for what each tag means.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🧰 20 个工具 — Tools
|
|
102
|
+
|
|
103
|
+
| 组 | 工具 | 干什么 |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| **实时检索(OTA/官方只读)** | `gotry_flyai_search` | 机票/火车/酒店实时报价(飞猪官方通道;酒店价格为上游打码展示,真实价以 jumpUrl 为准) |
|
|
106
|
+
| | `gotry_session_search` | 在**用户本人登录态**里查携程机票(授权后,只读) |
|
|
107
|
+
| | `gotry_session_login` | 登录引导:自动检测已登录与否,未登录才在用户 Chrome 弹登录入口(**零终端**) |
|
|
108
|
+
| | `gotry_weather_check` | Open-Meteo 预报≤16 天 + 历史气候基线 |
|
|
109
|
+
| | `gotry_flight_verify` | OpenSky ADS-B 航班实时观测(三值) |
|
|
110
|
+
| | `gotry_skeleton_check` | OpenFlights 168 对枢纽通航性(三值) |
|
|
111
|
+
| **库存与目录** | `gotry_hotel_search` | hotel-byte 实时桥,降级静态包(证据标注) |
|
|
112
|
+
| | `gotry_anything_search` | 城市/酒店/地标混合目录(hotel-be Anything) |
|
|
113
|
+
| **判定引擎** | `gotry_feasibility_check` | 门到门真成本可行性(Z3),逐候选判定 |
|
|
114
|
+
| **记忆与触达** | `gotry_motivation_save` | 动机画像落盘(evidence 强制,反幻觉) |
|
|
115
|
+
| | `gotry_wish_pool_add` / `gotry_wish_pool_list` | 「下一次出发」愿望池 + 0..1 条件召回 |
|
|
116
|
+
| | `gotry_companion_save` · `gotry_trip_log` | 同行人档案 / 旅行时间线 |
|
|
117
|
+
| **产物** | `gotry_artifacts_list` / `gotry_artifacts_read` | 发现与查看已生成的产物(异步交付 + 工作目录 markdown),行号文件视图,只读 |
|
|
118
|
+
| **通用外部** | `gotry_web_search` · `gotry_video_subtitle` · `gotry_github_search` · `gotry_agent_reach` | 网页/字幕/GitHub/全渠道外部信息(经 Agent-Reach) |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 🔐 账号会话:授权与隐私 — Account consent
|
|
123
|
+
|
|
124
|
+
会话检索使用**你本人已登录的 Chrome**读取酒店/机票实时数据,为此立了四条 hard 规则:
|
|
125
|
+
|
|
126
|
+
1. **登录在外部网站完成** —— gotry 从不提供、不代填、不收集任何密码/验证码/cookie 值。它只回答一个布尔问题:"登录票据 cookie 存在吗"(只读**名字**,0 值过手)。
|
|
127
|
+
2. **授权卡,每会话一次** —— 首次动用账号会话会弹运行时审批卡;批准后会话内记住,拒绝即本会话吊销,不再打扰。总闸 `sessionAccess: ask|allow|off` 随时可关。
|
|
128
|
+
3. **物理只读** —— ReadGuard 在网络层中止一切写请求(下单/支付在传输层不可达),agent 永不接触凭证与验证码;遇到验证码立即停,交还给你。
|
|
129
|
+
4. **绝不劫持你的浏览器** —— 检索/登录只开自己的独立标签页,登录页置前台、留在你那;例行动测试永不自动开浏览器窗。
|
|
130
|
+
|
|
131
|
+
> 前置(一次性):日常 Chrome 打开 `chrome://inspect/#remote-debugging` 打开开关(Chrome 144+),并保持 Chrome 在线。未开启时工具返回 `needs-attach` 并给出指引,不消耗执行配额。
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 🏛️ 架构 — Architecture
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
139
|
+
│ L1 对话即界面 chat-as-UI; gates 是消息内选择题 │
|
|
140
|
+
│ L2 编排 dsh 运行时 + GoTry 插件(ReAct);20 个工具 │
|
|
141
|
+
│ L3 领域 统一行程模型 + Z3 可行性引擎(枚举/Z3 双形态) │
|
|
142
|
+
│ L4 数据 静态数据包 + hotelbyte-cli 实时桥 + OpenFlights 骨架 │
|
|
143
|
+
│ L5 治理 LoopX(objective / gates / evidence / quota) │
|
|
144
|
+
└──────────────────────────────────────────────────────────────┘
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
| 层 | 模块 | 角色 |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| L2 | `ts/src/index.ts`(dsh 插件) | 注册 20 工具,挂时间锚点/记忆 brief 变量;execute 异常隔离 + 授权闸 + 进程护栏 |
|
|
150
|
+
| L3 | `ts/src/unified.ts` · `py/gotry_feasibility/` | 唯一求解入口(候选枚举 + 航班链 Z3) |
|
|
151
|
+
| L4 | `ts/capabilities/effect.ts` · `hbcli.ts` · `skeleton-check.ts` | 效应解译层(退避重试/断路器/mock 解译器,issue #16)+ 实时库存桥 + OpenFlights 骨架(三值语义) |
|
|
152
|
+
| L5 | loopx 治理面 | objective / gates / evidence / quota |
|
|
153
|
+
|
|
154
|
+
> 📖 完整 ADR / 演进 / 债务清单: [`docs/architecture.md`](docs/architecture.md)
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## ⚠️ 状态与限制 — Status & limitations
|
|
159
|
+
|
|
160
|
+
**今天可用的能力**(全栈回归 §1–§34 全绿,每项都有确定性测试):
|
|
161
|
+
|
|
162
|
+
- **Z3 求解引擎** —— 可行性判定 + 门到门全成本;历史并发竞态已根治(§30 并发回归闸)
|
|
163
|
+
- **实时检索**:机票/火车/酒店(飞猪官方通道)、目的地/酒店目录、天气、航班观测、通航性校验;可选让实时票价覆写进求解(`GOTRY_REALTIME_PRICING=1`)
|
|
164
|
+
- **账号会话检索**:你本人登录态查携程机票,授权与隐私规则见上方 **🔐 账号会话:授权与隐私** 小节
|
|
165
|
+
- **记忆与触达**:动机画像 / 愿望池 / 同行人 / 旅行时间线;英文输出一键切换(`GOTRY_LOCALE=en`)
|
|
166
|
+
|
|
167
|
+
**已知限制**(截至 2026-08-29,诚实清单):
|
|
168
|
+
|
|
169
|
+
- ⏳ **M3 Exit 未关闭** —— 工程与分发面就绪,但"真实种子用户"证据(50–200 人 cohort)尚未积累;自动化测试证明的是合同与公式,不是 business pass
|
|
170
|
+
- ⏳ **携程酒店 / 美团的登录态会话适配** —— 机票已通,酒店面等登录态实测回填(下一个 tick)
|
|
171
|
+
- ⏳ **界面语言** —— 英文界面仅覆盖求解确定性输出层;dsh 宿主界面与对话面属宿主/校准件
|
|
172
|
+
|
|
173
|
+
<details>
|
|
174
|
+
<summary>📖 更深的工程状态(账本合同 / 证据合同 / 里程碑口径)</summary>
|
|
175
|
+
|
|
176
|
+
状态权威面在这里,README 不展开:事务化状态账本(ADR-15)+ 双形态冻结(ADR-16:本地+Web 一套账本语义);M3 真实 cohort 证据合同已立(fixture 不充当 Exit,真实 50–200 人样本即开 Exit);M4 paired-cohort 价值证据合同(run-all §34)合成数据不充当 Exit 证据;异步工单终态合同(`gotry_async_terminal.v1`:4/4→succeeded/ledger settled/exit 0)。细则见 [`docs/roadmap.md`](docs/roadmap.md) / [`docs/architecture.md`](docs/architecture.md) §1 与 #19–#22。
|
|
177
|
+
|
|
178
|
+
</details>
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 📚 文档 — Docs
|
|
183
|
+
|
|
184
|
+
| 文档 | 适合谁 |
|
|
185
|
+
|---|---|
|
|
186
|
+
| [本 README](README.md) | **所有人**:是什么 · 怎么用 · 限制 |
|
|
187
|
+
| [`docs/architecture.md`](docs/architecture.md) | 工程师:分层 · ADR · 演进 · 债务 |
|
|
188
|
+
| [`docs/roadmap.md`](docs/roadmap.md) | 项目管理:M0–M6 与当前位置 |
|
|
189
|
+
| [`docs/user-guide.md`](docs/user-guide.md) | 终端用户:详细使用文档 |
|
|
190
|
+
| [`docs/gotry-product-design.md`](docs/gotry-product-design.md) | 产品:主循环 · 透明机制 · 全成本模型 |
|
|
191
|
+
| [`docs/gotry-master-outline.md`](docs/gotry-master-outline.md) | 决策者:工作分解 · 复用矩阵 |
|
|
192
|
+
| [`docs/kimi-postmortem.md`](docs/kimi-postmortem.md) | 所有人:真实 AI 旅行规划失败复盘(反面教材) |
|
|
193
|
+
| [`docs/release-notes.md`](docs/release-notes.md) | 历史:每个 tag 的发布闸勾稽 |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 🧪 跑测试 — Verify
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
./scripts/run-all-tests.sh
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
全栈一次性绿(纯 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)**。
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 🤝 参与开发 — Contributing
|
|
208
|
+
|
|
209
|
+
> *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).*
|
|
210
|
+
|
|
211
|
+
标准开源流程:**`main` 不直接推**——从最新 `main` 切出 `feat/ · fix/ · docs/ · chore/` 分支,本地全栈绿后开 Pull Request,CI(Node 22/24,typecheck + 全部套件)与维护者 review 双绿后 squash 合入。**测试红着不许合。**
|
|
212
|
+
|
|
213
|
+
- 完整贡献指南(环境搭建 · 测试 · 分支与提交约定 · PR 流程): **[CONTRIBUTING.md](CONTRIBUTING.md)**
|
|
214
|
+
- Bug / 功能建议:[issue 模板](.github/ISSUE_TEMPLATE/bug_report.yml)(搜过既有 issue 再提)
|
|
215
|
+
- 行为或架构改动先立 ADR(`docs/architecture.md` §8);多 agent 协作契约见 [`AGENTS.md`](AGENTS.md)
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 📜 License
|
|
220
|
+
|
|
221
|
+
**MIT**(2026-08-23 落定)。与上游 dsh(MIT)/ loopx 一致——宽松、可商用、可闭源分叉。文本见 [LICENSE](LICENSE)。
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 🌐 中英版 — Locales
|
|
226
|
+
|
|
227
|
+
- 本文件(main)**英文版独立成文**:[README.md](README.md)——两文件各自完整,常见开源双语布局。
|
|
228
|
+
- 深 README(中文)面向中国出境首发种子用户群;英文版是它的完整镜像(不含深度工程文档)。
|
|
229
|
+
- `docs/` 深度工程文档当前中文先行,英文版计划 v0.1.0 同步。
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
**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
|
|
234
|
+
|
|
235
|
+
**Last verified against `v0.0.1-rc.15`(2026-08-29)** — 全栈回归全绿 §1-§36(发布流程见 `scripts/publish-npm.sh`)。
|