{"id":"cb0eb0b8-6efb-4526-ac8f-8aae3db795ee","entityType":"agent","slug":"clawhub-jack4world-trail-nav-telegram","name":"Trail Nav via Telegram (low-token)","canonicalUrl":"https://www.xpersona.co/agent/clawhub-jack4world-trail-nav-telegram","canonicalPath":"/agent/clawhub-jack4world-trail-nav-telegram","generatedAt":"2026-10-11T20:57:31.275Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T15:50:23.004Z","emptyReason":null},"description":"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KM... Skill: Trail Nav via Telegram (low-token) Owner: jack4world Summary: Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KM... Tags: latest:0.3.2 Version history: v0.3.2 | 2026-02-21T17:08:00.122Z | user Fix one-click OpenClaw config patcher to use new skills schema (skills.load.extraDirs + skills.entries), with leg","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17dbynx3685n8nahtb3yet8ks8586em:trail-nav-telegram","sourceUrl":"https://clawhub.ai/jack4world/trail-nav-telegram","homepage":"https://clawhub.ai/jack4world/skills/trail-nav-telegram","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/jack4world/trail-nav-telegram","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/jack4world/skills/trail-nav-telegram","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KM..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:50:23.004Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:50:23.004Z","emptyReason":null},"stars":null,"forks":null,"downloads":1035,"packageName":null,"latestVersion":"0.3.2","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T15:50:22.944Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T15:50:23.004Z","lastCrawledAt":"2026-10-11T15:50:22.944Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T15:50:22.944Z","lastVerifiedAt":null,"highlights":[{"version":"0.3.2","createdAt":"2026-02-21T17:08:00.122Z","changelog":"Fix one-click OpenClaw config patcher to use new skills schema (skills.load.extraDirs + skills.entries), with legacy migration.","fileCount":22,"zipByteSize":33604},{"version":"0.3.1","createdAt":"2026-02-16T17:13:26.455Z","changelog":"True one-click OpenClaw integration: add openclaw_oneclick_setup.sh + patch_openclaw_config.js (backup .bak) to install/update outsideclaw and patch OpenClaw config; optional gateway restart. Add docs.","fileCount":22,"zipByteSize":33032},{"version":"0.3.0","createdAt":"2026-02-16T17:10:21.045Z","changelog":"Add one-command outsideclaw repo installer (outsideclaw_setup.sh) + OpenClaw config snippet generator for easy integration while keeping full outsideclaw CLI/DB. Include integration reference doc.","fileCount":19,"zipByteSize":30553},{"version":"0.2.1","createdAt":"2026-02-16T15:56:10.180Z","changelog":"Publish fix + updates: add ESM-friendly guide_route.mjs for Node runners; remove generated out/ artifacts from skill package; include share-bundles reference for agent-to-agent route sharing bundles.","fileCount":16,"zipByteSize":28589},{"version":"0.2.0","createdAt":"2026-02-16T14:25:19.479Z","changelog":"Add deterministic guide_route.js enhancements: key-node route alerts (ALERT line) with cooldown state + annotated map rendering (GeoJSON+alerts -> PNG). Integrate deterministic weather sharp-change alerts (WX ALERT) via Open-Meteo with day_hike/summit_camp/trail_run modes and caching.","fileCount":17,"zipByteSize":60657},{"version":"0.1.0","createdAt":"2026-02-16T10:01:15.053Z","changelog":"Initial release: Telegram-based hiking assistant workflow. Includes 2bulu public discovery scraper, KML parsing + route map rendering scripts, low-token off-route guide protocol, and safety/gear checklists.","fileCount":9,"zipByteSize":8799}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dbynx3685n8nahtb3yet8ks8586em:trail-nav-telegram","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T20:57:31.271Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jack4world-trail-nav-telegram/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T15:50:23.004Z","emptyReason":null},"readme":"Skill: Trail Nav via Telegram (low-token)\n\nOwner: jack4world\n\nSummary: Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KM...\n\nTags: latest:0.3.2\n\nVersion history:\n\nv0.3.2 | 2026-02-21T17:08:00.122Z | user\n\nFix one-click OpenClaw config patcher to use new skills schema (skills.load.extraDirs + skills.entries), with legacy migration.\n\nv0.3.1 | 2026-02-16T17:13:26.455Z | user\n\nTrue one-click OpenClaw integration: add openclaw_oneclick_setup.sh + patch_openclaw_config.js (backup .bak) to install/update outsideclaw and patch OpenClaw config; optional gateway restart. Add docs.\n\nv0.3.0 | 2026-02-16T17:10:21.045Z | user\n\nAdd one-command outsideclaw repo installer (outsideclaw_setup.sh) + OpenClaw config snippet generator for easy integration while keeping full outsideclaw CLI/DB. Include integration reference doc.\n\nv0.2.1 | 2026-02-16T15:56:10.180Z | user\n\nPublish fix + updates: add ESM-friendly guide_route.mjs for Node runners; remove generated out/ artifacts from skill package; include share-bundles reference for agent-to-agent route sharing bundles.\n\nv0.2.0 | 2026-02-16T14:25:19.479Z | user\n\nAdd deterministic guide_route.js enhancements: key-node route alerts (ALERT line) with cooldown state + annotated map rendering (GeoJSON+alerts -> PNG). Integrate deterministic weather sharp-change alerts (WX ALERT) via Open-Meteo with day_hike/summit_camp/trail_run modes and caching.\n\nv0.1.0 | 2026-02-16T10:01:15.053Z | user\n\nInitial release: Telegram-based hiking assistant workflow. Includes 2bulu public discovery scraper, KML parsing + route map rendering scripts, low-token off-route guide protocol, and safety/gear checklists.\n\nArchive index:\n\nArchive v0.3.2: 22 files, 33604 bytes\n\nFiles: _meta.json (137b), references/2bulu-notes.md (814b), references/gear-list-overnight.md (598b), references/guide-protocol.md (1740b), references/openclaw-oneclick.md (654b), references/outsideclaw-integration.md (919b), references/qiniangshan_alerts.json (2153b), references/route-alerts.md (1481b), references/safety-checklist.md (746b), references/share-bundles.md (894b), scripts/generate_openclaw_snippet.js (722b), scripts/guide_route.js (16961b), scripts/guide_route.mjs (16961b), scripts/openclaw_oneclick_setup.sh (1202b), scripts/outsideclaw_setup.sh (1291b), scripts/parse_2bulu_kml.js (3109b), scripts/patch_openclaw_config.js (3900b), scripts/render_route_map_annotated.js (5423b), scripts/render_route_map.js (3098b), scripts/scrape_2bulu_tracks.js (2269b), scripts/weather_alert.js (5358b), SKILL.md (3855b)\n\nFile v0.3.2:SKILL.md\n\n---\nname: trail-nav-telegram\ndescription: \"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KML route, (2) answers 'am I off-route / which way should I go' with low-token fixed outputs, (3) scrapes/publicly discovers route links from 2bulu track_search, and (4) prepares trip risk checklists + gear lists for an overnight hike.\"\n---\n\n# Trail Nav via Telegram (low-token)\n\n## Goals\n- Use Telegram (iOS) as the UI: user sends **location** + short commands.\n- Keep token usage minimal: do **all geometry calculations deterministically**, use LLM only for optional wording.\n- Respect access controls: **do not bypass logins/captchas** on external sites.\n\n## Quick workflow\n1) **Import route** (GPX/KML) → build a compact RoutePack (simplified polyline + bbox + endpoints).\n2) **Bind** route to the chat (`/use <routeId>`).\n3) **Guide**: user sends location (or `/g` + location) → reply with 2-line output (machine line + Chinese template).\n\n## Token-saving rules (hard)\n- Never send full KML/GPX text into the LLM context.\n- Parse route once; store `routeId` + simplified points.\n- Output is fixed schema (see references/guide-protocol.md).\n- Cache per-chat state: `activeRouteId`, `lastIdx`.\n\n## External discovery (2bulu)\nTwo supported modes:\n\n1) **Public discovery (no login)**\n- Only scrape **public list/search pages** (e.g. `/track/track_search.htm`, `/track/search-<keyword>.htm`).\n- Store: title + url + scraped_at.\n\n2) **Manual-login assist (optional)**\n- If the user manually logs in (WeChat/QQ/etc.) in a persistent browser profile, automation may proceed **within that same profile**.\n- Login/captcha steps must be completed by the user. Do **not** bypass access controls.\n\nPreferred alternative (often simplest): ask the user to export/send the **GPX/KML file via Telegram**; then operate purely on the user-provided route file.\n\n## Safety reminders\n- Provide explicit **no-signal** / SOS guidance. See references/safety-checklist.md.\n- Encourage “hard cutoffs” for overnight hikes (time, wind/fog, hydration).\n\n## Bundled resources\n- Scripts:\n  - `scripts/scrape_2bulu_tracks.js` list-page scraper → JSON/CSV + screenshot\n  - `scripts/parse_2bulu_kml.js` parse KML → stats + geojson + routepack\n  - `scripts/render_route_map.js` render route HTML+PNG map for sharing\n  - `scripts/render_route_map_annotated.js` render annotated map (GeoJSON + alerts) to HTML+PNG\n  - `scripts/guide_route.js` deterministic off-route guidance from GeoJSON + current location (outputs the 2-4 line guide protocol)\n  - `scripts/weather_alert.js` deterministic weather change alert (Open-Meteo) for day_hike/summit_camp/trail_run modes\n  - `scripts/outsideclaw_setup.sh` one-command install/update outsideclaw repo into ~/.outsideclaw/app/outsideclaw\n  - `scripts/generate_openclaw_snippet.js` prints an OpenClaw config snippet pointing to the installed outsideclaw skill\n  - `scripts/patch_openclaw_config.js` patches an OpenClaw config JSON to include the installed skill path (creates .bak)\n  - `scripts/openclaw_oneclick_setup.sh` one-click: install outsideclaw + patch config (+ optional gateway restart)\n- References:\n  - `references/2bulu-notes.md`\n  - `references/guide-protocol.md`\n  - `references/safety-checklist.md`\n  - `references/gear-list-overnight.md`\n  - `references/qiniangshan_alerts.json` risk-based key-node alerts (used for map annotations + alert triggering)\n  - `references/route-alerts.md` alerts schema + how to apply to any route\n  - `references/share-bundles.md` share route bundles between outsideclaw agents\n  - `references/outsideclaw-integration.md` install outsideclaw repo + generate OpenClaw config snippet\n  - `references/openclaw-oneclick.md` one-click OpenClaw integration (install + patch + optional restart)\n\nFile v0.3.2:_meta.json\n\n{\n  \"ownerId\": \"kn78xejze79zk1q8vrfhe4dk8n80nd6n\",\n  \"slug\": \"trail-nav-telegram\",\n  \"version\": \"0.3.2\",\n  \"publishedAt\": 1771693680122\n}\n\nFile v0.3.2:references/2bulu-notes.md\n\n# 2bulu notes (public scraping)\n\n## Useful pages\n- Track search/list: https://www.2bulu.com/track/track_search.htm\n- Keyword search results: https://www.2bulu.com/track/search-<urlencoded>.htm\n\n## What is safe to do\n- Scrape public list/search results: titles + URLs.\n- Treat as discovery links; store minimal metadata.\n\n## Manual login (allowed with user involvement)\n- Manual login is allowed: user completes WeChat/QQ login and any captcha in the browser.\n- Automation may continue **only in the same persisted browser profile**.\n\n## What to avoid\n- Do not bypass login/captcha.\n- Track-detail downloads may redirect to login; prefer user-exported GPX/KML sent via Telegram when possible.\n\n## Data quality\n- List page may contain duplicate links with query params (e.g. ?tabType=2). Normalize and de-duplicate.\n\nFile v0.3.2:references/gear-list-overnight.md\n\n# Gear list (2-person, 1-night ridge/summit camp)\n\n## Must\n- Shelter: tent + stakes + guylines\n- Sleep: sleeping bag (rated for windchill) + sleeping pad\n- Light: headlamp per person + spare power\n- Power: power bank\n- Clothing: wind/rain shell + insulation layer + spare base + hat + gloves\n- Safety: basic first-aid + emergency blanket + whistle\n- Water: assume no refill; carry enough\n- Food: dinner + breakfast + trail snacks + 20% buffer\n\n## Strongly recommended\n- Extra guylines, stronger stakes, tape/zip ties\n- Electrolytes\n- Trekking poles\n\n## Optional\n- Knee support, camp light, sit pad\n\nFile v0.3.2:references/guide-protocol.md\n\n# Low-token guide protocol (Telegram)\n\nRoute ID used in examples: `qiniangshan_jinghua`\n\n## Route acquisition\n- Preferred: user exports/sends GPX/KML via Telegram → deterministic parsing.\n- Optional: user manually logs in to 2bulu in a persistent browser profile; automation may assist after login (no bypass).\n\n## Commands\n- `/use <routeId>` bind route to current chat.\n- `/g` guide once. Location-only message may be treated as `/g`.\n\n## Output (2-4 lines)\nLine 1 (machine):\n`G S:<0|1|2> D:<m> B:<deg><dir> GO:<m> IDX:<n>`\n\n- S: 0=on_route, 1=off_route, 2=arrived\n- D: distance to route (m)\n- B: bearing degrees + dir (N/NE/E/SE/S/SW/W/NW)\n- GO: recommended distance (m) to rejoin/advance\n- IDX: nearest point index (for incremental window search)\n\nLine 2 (Chinese template, deterministic):\n- on_route: `在路线内（偏离{D}米）。朝{dir}（{B}°）前进约{GO}米。`\n- off_route: `你已偏离路线约{D}米。请朝{dir}（{B}°）走约{GO}米回到路线。`\n- arrived: `你已接近终点（{D}米内）。建议在此附近确认营地/下撤方向。`\n\nLine 3 (optional alert, if near a key node):\n`ALERT <letter>: <message>`\n\nLine 4 (optional weather alert, if enabled and sharp change detected):\n`WX ALERT: <CODE> <brief>`\n\n## Defaults\n- toleranceM=50\n- arrivedM=60\n- lookaheadM=120\n- bboxGuardM=2000 (if far from bbox, return E:OUT_OF_BBOX)\n\n## Reference implementation\n- `scripts/guide_route.js`: given a GeoJSON LineString + (lat,lon) (+ optional lastIdx), prints the 2-3 line response.\n  - Add `--alerts references/<route>_alerts.json` to enable key-node alerts.\n  - Add `--state /tmp/guide_state.json --cooldown-sec 1800` to dedupe alerts.\n\n## Errors (single line)\n- `E:NO_ROUTE`\n- `E:OUT_OF_BBOX`\n- `E:GPS_BAD`\n\nFile v0.3.2:references/openclaw-oneclick.md\n\n# OpenClaw one-click setup (outsideclaw via trail-nav-telegram)\n\nGoal: make it easy for developers to integrate the full outsideclaw repo/CLI into OpenClaw with minimal steps.\n\n## What it does\n1) Install/update outsideclaw repo to `~/.outsideclaw/app/outsideclaw`\n2) Patch an OpenClaw config JSON to load the installed skill path\n3) Optional: restart OpenClaw gateway\n\n## Usage\n```bash\nbash scripts/openclaw_oneclick_setup.sh --config /path/to/openclaw.config.json --restart\n```\n\n## Safety\n- Creates a backup: `<config>.bak`\n- Only appends the skill entry if not already present\n\n## Notes\n- If `openclaw` CLI isn't on PATH, restart the gateway manually.\n\nFile v0.3.2:references/outsideclaw-integration.md\n\n# outsideclaw integration (via trail-nav-telegram skill)\n\nGoal: keep outsideclaw as the full repo/CLI, but make it easy to import into OpenClaw.\n\n## 1) Install/update outsideclaw repo\nRun:\n```bash\nbash scripts/outsideclaw_setup.sh\n```\n\nDefault install location:\n- `~/.outsideclaw/app/outsideclaw`\n\nThis also runs:\n- `npm install`\n- `npm run setup` (creates DB + routes dirs)\n\n## 2) Generate OpenClaw config snippet\n```bash\nnode scripts/generate_openclaw_snippet.js\n```\n\nCopy the JSON snippet into your OpenClaw config's `skills` list.\n\n## 3) Use outsideclaw CLI\nOnce installed:\n```bash\ncd ~/.outsideclaw/app/outsideclaw\nnpm run setup\nnpm run import:kml -- /path/to/route.kml\nnpm run import:gpx -- /path/to/route.gpx\nnpm run guide -- <routeId> <lat> <lon> --wx on --mode day_hike\n```\n\nNotes:\n- outsideclaw is local-first (DB defaults to `~/.outsideclaw/outsideclaw.sqlite`).\n- Do not bypass external site login/captcha.\n\nFile v0.3.2:references/qiniangshan_alerts.json\n\n{\n  \"routeId\": \"qiniangshan_jinghua\",\n  \"routeName\": \"七娘山精华线\",\n  \"version\": 1,\n  \"match\": {\n    \"radiusM\": 120,\n    \"note\": \"Trigger when user location is within radiusM of a node. Use a cooldown to avoid spam.\"\n  },\n  \"nodes\": [\n    {\n      \"id\": \"start-trailhead\",\n      \"kind\": \"trailhead\",\n      \"letter\": \"A\",\n      \"name\": \"起点/登山口（大榕树）\",\n      \"lat\": 22.531146,\n      \"lon\": 114.516312,\n      \"altM\": 9,\n      \"atDistanceM\": 0,\n      \"message\": \"到登山口：检查头灯/备用电、雨衣、风绳地钉、哨子；水量不足先补。设定报平安时间。\"\n    },\n    {\n      \"id\": \"steep-section\",\n      \"kind\": \"hazard\",\n      \"letter\": \"B\",\n      \"name\": \"最陡拉升段（约100m爬升70m）\",\n      \"lat\": 22.5196,\n      \"lon\": 114.5376,\n      \"atDistanceM\": 3830,\n      \"window\": {\n        \"fromM\": 3780,\n        \"toM\": 3884\n      },\n      \"message\": \"前方最陡拉升段：补能量/小口喝水；路湿或风大就慢走，注意滑倒与抽筋。\"\n    },\n    {\n      \"id\": \"highpoint\",\n      \"kind\": \"summit_or_ridge\",\n      \"letter\": \"C\",\n      \"name\": \"最高点/山脊风险区\",\n      \"lat\": 22.525039,\n      \"lon\": 114.543805,\n      \"altM\": 873,\n      \"atDistanceM\": 4894,\n      \"message\": \"到山脊/高点：阵风更强体感更冷，立刻加衣戴帽手套；雾大别贴崖边。若要过夜，选背风平整处并加固帐篷。\"\n    },\n    {\n      \"id\": \"descent-start\",\n      \"kind\": \"descent\",\n      \"letter\": \"D\",\n      \"name\": \"下撤开始（膝踝风险上升）\",\n      \"lat\": 22.526848,\n      \"lon\": 114.536725,\n      \"altM\": 479,\n      \"atDistanceM\": 5898,\n      \"message\": \"开始下撤：用登山杖、步子小别跳；注意膝盖/脚踝与碎石滑倒。天黑前确认头灯电量。\"\n    },\n    {\n      \"id\": \"end-busstop\",\n      \"kind\": \"finish\",\n      \"letter\": \"E\",\n      \"name\": \"终点（国家地质公园公交站附近）\",\n      \"lat\": 22.531152,\n      \"lon\": 114.523186,\n      \"altM\": 48,\n      \"atDistanceM\": 7863,\n      \"message\": \"到终点：立刻发报平安（含时间+状态+位置）。下撤结束也容易出事，别松懈。\"\n    }\n  ]\n}\n\nFile v0.3.2:references/route-alerts.md\n\n# Route alerts (key nodes) — schema + usage\n\nGoal: add **route-specific key-node reminders** (hazards / ridge / descent start / water / campsite) with **low-token** output.\n\n## Files\n- Alerts config: `references/<routeId>_alerts.json` (example: `qiniangshan_alerts.json`)\n- Guide script: `scripts/guide_route.js`\n\n## Alerts JSON schema (minimal)\n```json\n{\n  \"routeId\": \"your_route_id\",\n  \"routeName\": \"Human name\",\n  \"match\": { \"radiusM\": 120 },\n  \"nodes\": [\n    {\n      \"id\": \"unique-node-id\",\n      \"letter\": \"A\",\n      \"kind\": \"hazard|trailhead|summit_or_ridge|descent|finish|water|campsite|node\",\n      \"name\": \"Label shown on map\",\n      \"lat\": 0,\n      \"lon\": 0,\n      \"message\": \"Chinese reminder text\"\n    }\n  ]\n}\n```\n\nNotes:\n- `match.radiusM` is the trigger radius.\n- `letter` is used in `ALERT <letter>:` output and for map labels.\n- Add as many nodes as you want; keep messages short.\n\n## Using alerts with guide_route\n`guide_route.js` prints the standard 2-line guide output, and optionally a 3rd line:\n\n- `ALERT <letter>: <message>`\n\nExample:\n```bash\nnode scripts/guide_route.js route.geojson 22.53 114.52 123 \\\n  --alerts references/qiniangshan_alerts.json \\\n  --state out/alert_state.json \\\n  --cooldown-sec 900\n```\n\n## Cooldown (anti-spam)\n- Use `--state <path>` to persist per-node last-trigger timestamps.\n- Use `--cooldown-sec <n>` (default recommended: 900s).\n\n## Rendering annotated map\nUse `scripts/render_route_map_annotated.js` with the same alerts JSON.\n\nFile v0.3.2:references/safety-checklist.md\n\n# Overnight hike safety checklist (signal + SOS)\n\n## Signal reality\n- Do not assume full cellular coverage on the entire trail.\n\n## Pre-trip\n- Share itinerary with a trusted contact (start / camp / descend / finish check-ins + latest check-in time).\n- Enable iPhone Emergency SOS + emergency contacts.\n- Carry power bank + spare cables.\n- Bring whistle + headlamp.\n\n## During trip\n- Check-in at: trailhead, mid-trail, campsite set, start descent, trail end.\n- If signal weak: move to open ridge/clearing; try SMS/phone first.\n\n## If emergency\n- If signal: call 110/120; share coordinates + status + headcount.\n- If no signal: stay together; prioritize warmth/shelter; move to open area; use whistle (3 short bursts repeating) + headlamp flashes.\n\nFile v0.3.2:references/share-bundles.md\n\n# Share routes (outsideclaw bundles)\n\nGoal: share a route (and optional alerts) with another person's outsideclaw agent without relying on external platforms.\n\n## Bundle format\n- `.tar.gz` containing:\n  - `manifest.json` (kind: `outsideclaw.route.bundle`)\n  - `route.geojson`\n  - `routepack.json`\n  - `meta.json`\n  - optional `alerts.json`\n\n## outsideclaw CLI workflow\nCreate bundle (sender):\n```bash\nnpm run share:route -- <routeId> [--alerts /path/to/alerts.json]\n```\n\nImport bundle (receiver):\n```bash\nnpm run import:bundle -- /path/to/outsideclaw-route-<routeId>-*.tar.gz\n```\n\n## Telegram workflow (planned)\n- `/share <routeId>` → bot replies with the `.tar.gz` file\n- Receiver forwards the file to their bot → bot auto-imports and replies with `/use <routeId>` instructions\n\nSecurity notes:\n- Validate `manifest.json.kind` before importing.\n- Extract only into a controlled directory.\n\nArchive v0.3.1: 22 files, 33032 bytes\n\nFiles: references/2bulu-notes.md (814b), references/gear-list-overnight.md (598b), references/guide-protocol.md (1740b), references/openclaw-oneclick.md (654b), references/outsideclaw-integration.md (919b), references/qiniangshan_alerts.json (2153b), references/route-alerts.md (1481b), references/safety-checklist.md (746b), references/share-bundles.md (894b), scripts/generate_openclaw_snippet.js (722b), scripts/guide_route.js (16961b), scripts/guide_route.mjs (16961b), scripts/openclaw_oneclick_setup.sh (1202b), scripts/outsideclaw_setup.sh (1291b), scripts/parse_2bulu_kml.js (3109b), scripts/patch_openclaw_config.js (2078b), scripts/render_route_map_annotated.js (5423b), scripts/render_route_map.js (3098b), scripts/scrape_2bulu_tracks.js (2269b), scripts/weather_alert.js (5358b), SKILL.md (3855b), _meta.json (137b)\n\nFile v0.3.1:SKILL.md\n\n---\nname: trail-nav-telegram\ndescription: \"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KML route, (2) answers 'am I off-route / which way should I go' with low-token fixed outputs, (3) scrapes/publicly discovers route links from 2bulu track_search, and (4) prepares trip risk checklists + gear lists for an overnight hike.\"\n---\n\n# Trail Nav via Telegram (low-token)\n\n## Goals\n- Use Telegram (iOS) as the UI: user sends **location** + short commands.\n- Keep token usage minimal: do **all geometry calculations deterministically**, use LLM only for optional wording.\n- Respect access controls: **do not bypass logins/captchas** on external sites.\n\n## Quick workflow\n1) **Import route** (GPX/KML) → build a compact RoutePack (simplified polyline + bbox + endpoints).\n2) **Bind** route to the chat (`/use <routeId>`).\n3) **Guide**: user sends location (or `/g` + location) → reply with 2-line output (machine line + Chinese template).\n\n## Token-saving rules (hard)\n- Never send full KML/GPX text into the LLM context.\n- Parse route once; store `routeId` + simplified points.\n- Output is fixed schema (see references/guide-protocol.md).\n- Cache per-chat state: `activeRouteId`, `lastIdx`.\n\n## External discovery (2bulu)\nTwo supported modes:\n\n1) **Public discovery (no login)**\n- Only scrape **public list/search pages** (e.g. `/track/track_search.htm`, `/track/search-<keyword>.htm`).\n- Store: title + url + scraped_at.\n\n2) **Manual-login assist (optional)**\n- If the user manually logs in (WeChat/QQ/etc.) in a persistent browser profile, automation may proceed **within that same profile**.\n- Login/captcha steps must be completed by the user. Do **not** bypass access controls.\n\nPreferred alternative (often simplest): ask the user to export/send the **GPX/KML file via Telegram**; then operate purely on the user-provided route file.\n\n## Safety reminders\n- Provide explicit **no-signal** / SOS guidance. See references/safety-checklist.md.\n- Encourage “hard cutoffs” for overnight hikes (time, wind/fog, hydration).\n\n## Bundled resources\n- Scripts:\n  - `scripts/scrape_2bulu_tracks.js` list-page scraper → JSON/CSV + screenshot\n  - `scripts/parse_2bulu_kml.js` parse KML → stats + geojson + routepack\n  - `scripts/render_route_map.js` render route HTML+PNG map for sharing\n  - `scripts/render_route_map_annotated.js` render annotated map (GeoJSON + alerts) to HTML+PNG\n  - `scripts/guide_route.js` deterministic off-route guidance from GeoJSON + current location (outputs the 2-4 line guide protocol)\n  - `scripts/weather_alert.js` deterministic weather change alert (Open-Meteo) for day_hike/summit_camp/trail_run modes\n  - `scripts/outsideclaw_setup.sh` one-command install/update outsideclaw repo into ~/.outsideclaw/app/outsideclaw\n  - `scripts/generate_openclaw_snippet.js` prints an OpenClaw config snippet pointing to the installed outsideclaw skill\n  - `scripts/patch_openclaw_config.js` patches an OpenClaw config JSON to include the installed skill path (creates .bak)\n  - `scripts/openclaw_oneclick_setup.sh` one-click: install outsideclaw + patch config (+ optional gateway restart)\n- References:\n  - `references/2bulu-notes.md`\n  - `references/guide-protocol.md`\n  - `references/safety-checklist.md`\n  - `references/gear-list-overnight.md`\n  - `references/qiniangshan_alerts.json` risk-based key-node alerts (used for map annotations + alert triggering)\n  - `references/route-alerts.md` alerts schema + how to apply to any route\n  - `references/share-bundles.md` share route bundles between outsideclaw agents\n  - `references/outsideclaw-integration.md` install outsideclaw repo + generate OpenClaw config snippet\n  - `references/openclaw-oneclick.md` one-click OpenClaw integration (install + patch + optional restart)\n\nFile v0.3.1:_meta.json\n\n{\n  \"ownerId\": \"kn78xejze79zk1q8vrfhe4dk8n80nd6n\",\n  \"slug\": \"trail-nav-telegram\",\n  \"version\": \"0.3.1\",\n  \"publishedAt\": 1771262006455\n}\n\nFile v0.3.1:references/2bulu-notes.md\n\n# 2bulu notes (public scraping)\n\n## Useful pages\n- Track search/list: https://www.2bulu.com/track/track_search.htm\n- Keyword search results: https://www.2bulu.com/track/search-<urlencoded>.htm\n\n## What is safe to do\n- Scrape public list/search results: titles + URLs.\n- Treat as discovery links; store minimal metadata.\n\n## Manual login (allowed with user involvement)\n- Manual login is allowed: user completes WeChat/QQ login and any captcha in the browser.\n- Automation may continue **only in the same persisted browser profile**.\n\n## What to avoid\n- Do not bypass login/captcha.\n- Track-detail downloads may redirect to login; prefer user-exported GPX/KML sent via Telegram when possible.\n\n## Data quality\n- List page may contain duplicate links with query params (e.g. ?tabType=2). Normalize and de-duplicate.\n\nFile v0.3.1:references/gear-list-overnight.md\n\n# Gear list (2-person, 1-night ridge/summit camp)\n\n## Must\n- Shelter: tent + stakes + guylines\n- Sleep: sleeping bag (rated for windchill) + sleeping pad\n- Light: headlamp per person + spare power\n- Power: power bank\n- Clothing: wind/rain shell + insulation layer + spare base + hat + gloves\n- Safety: basic first-aid + emergency blanket + whistle\n- Water: assume no refill; carry enough\n- Food: dinner + breakfast + trail snacks + 20% buffer\n\n## Strongly recommended\n- Extra guylines, stronger stakes, tape/zip ties\n- Electrolytes\n- Trekking poles\n\n## Optional\n- Knee support, camp light, sit pad\n\nFile v0.3.1:references/guide-protocol.md\n\n# Low-token guide protocol (Telegram)\n\nRoute ID used in examples: `qiniangshan_jinghua`\n\n## Route acquisition\n- Preferred: user exports/sends GPX/KML via Telegram → deterministic parsing.\n- Optional: user manually logs in to 2bulu in a persistent browser profile; automation may assist after login (no bypass).\n\n## Commands\n- `/use <routeId>` bind route to current chat.\n- `/g` guide once. Location-only message may be treated as `/g`.\n\n## Output (2-4 lines)\nLine 1 (machine):\n`G S:<0|1|2> D:<m> B:<deg><dir> GO:<m> IDX:<n>`\n\n- S: 0=on_route, 1=off_route, 2=arrived\n- D: distance to route (m)\n- B: bearing degrees + dir (N/NE/E/SE/S/SW/W/NW)\n- GO: recommended distance (m) to rejoin/advance\n- IDX: nearest point index (for incremental window search)\n\nLine 2 (Chinese template, deterministic):\n- on_route: `在路线内（偏离{D}米）。朝{dir}（{B}°）前进约{GO}米。`\n- off_route: `你已偏离路线约{D}米。请朝{dir}（{B}°）走约{GO}米回到路线。`\n- arrived: `你已接近终点（{D}米内）。建议在此附近确认营地/下撤方向。`\n\nLine 3 (optional alert, if near a key node):\n`ALERT <letter>: <message>`\n\nLine 4 (optional weather alert, if enabled and sharp change detected):\n`WX ALERT: <CODE> <brief>`\n\n## Defaults\n- toleranceM=50\n- arrivedM=60\n- lookaheadM=120\n- bboxGuardM=2000 (if far from bbox, return E:OUT_OF_BBOX)\n\n## Reference implementation\n- `scripts/guide_route.js`: given a GeoJSON LineString + (lat,lon) (+ optional lastIdx), prints the 2-3 line response.\n  - Add `--alerts references/<route>_alerts.json` to enable key-node alerts.\n  - Add `--state /tmp/guide_state.json --cooldown-sec 1800` to dedupe alerts.\n\n## Errors (single line)\n- `E:NO_ROUTE`\n- `E:OUT_OF_BBOX`\n- `E:GPS_BAD`\n\nFile v0.3.1:references/openclaw-oneclick.md\n\n# OpenClaw one-click setup (outsideclaw via trail-nav-telegram)\n\nGoal: make it easy for developers to integrate the full outsideclaw repo/CLI into OpenClaw with minimal steps.\n\n## What it does\n1) Install/update outsideclaw repo to `~/.outsideclaw/app/outsideclaw`\n2) Patch an OpenClaw config JSON to load the installed skill path\n3) Optional: restart OpenClaw gateway\n\n## Usage\n```bash\nbash scripts/openclaw_oneclick_setup.sh --config /path/to/openclaw.config.json --restart\n```\n\n## Safety\n- Creates a backup: `<config>.bak`\n- Only appends the skill entry if not already present\n\n## Notes\n- If `openclaw` CLI isn't on PATH, restart the gateway manually.\n\nFile v0.3.1:references/outsideclaw-integration.md\n\n# outsideclaw integration (via trail-nav-telegram skill)\n\nGoal: keep outsideclaw as the full repo/CLI, but make it easy to import into OpenClaw.\n\n## 1) Install/update outsideclaw repo\nRun:\n```bash\nbash scripts/outsideclaw_setup.sh\n```\n\nDefault install location:\n- `~/.outsideclaw/app/outsideclaw`\n\nThis also runs:\n- `npm install`\n- `npm run setup` (creates DB + routes dirs)\n\n## 2) Generate OpenClaw config snippet\n```bash\nnode scripts/generate_openclaw_snippet.js\n```\n\nCopy the JSON snippet into your OpenClaw config's `skills` list.\n\n## 3) Use outsideclaw CLI\nOnce installed:\n```bash\ncd ~/.outsideclaw/app/outsideclaw\nnpm run setup\nnpm run import:kml -- /path/to/route.kml\nnpm run import:gpx -- /path/to/route.gpx\nnpm run guide -- <routeId> <lat> <lon> --wx on --mode day_hike\n```\n\nNotes:\n- outsideclaw is local-first (DB defaults to `~/.outsideclaw/outsideclaw.sqlite`).\n- Do not bypass external site login/captcha.\n\nFile v0.3.1:references/qiniangshan_alerts.json\n\n{\n  \"routeId\": \"qiniangshan_jinghua\",\n  \"routeName\": \"七娘山精华线\",\n  \"version\": 1,\n  \"match\": {\n    \"radiusM\": 120,\n    \"note\": \"Trigger when user location is within radiusM of a node. Use a cooldown to avoid spam.\"\n  },\n  \"nodes\": [\n    {\n      \"id\": \"start-trailhead\",\n      \"kind\": \"trailhead\",\n      \"letter\": \"A\",\n      \"name\": \"起点/登山口（大榕树）\",\n      \"lat\": 22.531146,\n      \"lon\": 114.516312,\n      \"altM\": 9,\n      \"atDistanceM\": 0,\n      \"message\": \"到登山口：检查头灯/备用电、雨衣、风绳地钉、哨子；水量不足先补。设定报平安时间。\"\n    },\n    {\n      \"id\": \"steep-section\",\n      \"kind\": \"hazard\",\n      \"letter\": \"B\",\n      \"name\": \"最陡拉升段（约100m爬升70m）\",\n      \"lat\": 22.5196,\n      \"lon\": 114.5376,\n      \"atDistanceM\": 3830,\n      \"window\": {\n        \"fromM\": 3780,\n        \"toM\": 3884\n      },\n      \"message\": \"前方最陡拉升段：补能量/小口喝水；路湿或风大就慢走，注意滑倒与抽筋。\"\n    },\n    {\n      \"id\": \"highpoint\",\n      \"kind\": \"summit_or_ridge\",\n      \"letter\": \"C\",\n      \"name\": \"最高点/山脊风险区\",\n      \"lat\": 22.525039,\n      \"lon\": 114.543805,\n      \"altM\": 873,\n      \"atDistanceM\": 4894,\n      \"message\": \"到山脊/高点：阵风更强体感更冷，立刻加衣戴帽手套；雾大别贴崖边。若要过夜，选背风平整处并加固帐篷。\"\n    },\n    {\n      \"id\": \"descent-start\",\n      \"kind\": \"descent\",\n      \"letter\": \"D\",\n      \"name\": \"下撤开始（膝踝风险上升）\",\n      \"lat\": 22.526848,\n      \"lon\": 114.536725,\n      \"altM\": 479,\n      \"atDistanceM\": 5898,\n      \"message\": \"开始下撤：用登山杖、步子小别跳；注意膝盖/脚踝与碎石滑倒。天黑前确认头灯电量。\"\n    },\n    {\n      \"id\": \"end-busstop\",\n      \"kind\": \"finish\",\n      \"letter\": \"E\",\n      \"name\": \"终点（国家地质公园公交站附近）\",\n      \"lat\": 22.531152,\n      \"lon\": 114.523186,\n      \"altM\": 48,\n      \"atDistanceM\": 7863,\n      \"message\": \"到终点：立刻发报平安（含时间+状态+位置）。下撤结束也容易出事，别松懈。\"\n    }\n  ]\n}\n\nFile v0.3.1:references/route-alerts.md\n\n# Route alerts (key nodes) — schema + usage\n\nGoal: add **route-specific key-node reminders** (hazards / ridge / descent start / water / campsite) with **low-token** output.\n\n## Files\n- Alerts config: `references/<routeId>_alerts.json` (example: `qiniangshan_alerts.json`)\n- Guide script: `scripts/guide_route.js`\n\n## Alerts JSON schema (minimal)\n```json\n{\n  \"routeId\": \"your_route_id\",\n  \"routeName\": \"Human name\",\n  \"match\": { \"radiusM\": 120 },\n  \"nodes\": [\n    {\n      \"id\": \"unique-node-id\",\n      \"letter\": \"A\",\n      \"kind\": \"hazard|trailhead|summit_or_ridge|descent|finish|water|campsite|node\",\n      \"name\": \"Label shown on map\",\n      \"lat\": 0,\n      \"lon\": 0,\n      \"message\": \"Chinese reminder text\"\n    }\n  ]\n}\n```\n\nNotes:\n- `match.radiusM` is the trigger radius.\n- `letter` is used in `ALERT <letter>:` output and for map labels.\n- Add as many nodes as you want; keep messages short.\n\n## Using alerts with guide_route\n`guide_route.js` prints the standard 2-line guide output, and optionally a 3rd line:\n\n- `ALERT <letter>: <message>`\n\nExample:\n```bash\nnode scripts/guide_route.js route.geojson 22.53 114.52 123 \\\n  --alerts references/qiniangshan_alerts.json \\\n  --state out/alert_state.json \\\n  --cooldown-sec 900\n```\n\n## Cooldown (anti-spam)\n- Use `--state <path>` to persist per-node last-trigger timestamps.\n- Use `--cooldown-sec <n>` (default recommended: 900s).\n\n## Rendering annotated map\nUse `scripts/render_route_map_annotated.js` with the same alerts JSON.\n\nFile v0.3.1:references/safety-checklist.md\n\n# Overnight hike safety checklist (signal + SOS)\n\n## Signal reality\n- Do not assume full cellular coverage on the entire trail.\n\n## Pre-trip\n- Share itinerary with a trusted contact (start / camp / descend / finish check-ins + latest check-in time).\n- Enable iPhone Emergency SOS + emergency contacts.\n- Carry power bank + spare cables.\n- Bring whistle + headlamp.\n\n## During trip\n- Check-in at: trailhead, mid-trail, campsite set, start descent, trail end.\n- If signal weak: move to open ridge/clearing; try SMS/phone first.\n\n## If emergency\n- If signal: call 110/120; share coordinates + status + headcount.\n- If no signal: stay together; prioritize warmth/shelter; move to open area; use whistle (3 short bursts repeating) + headlamp flashes.\n\nFile v0.3.1:references/share-bundles.md\n\n# Share routes (outsideclaw bundles)\n\nGoal: share a route (and optional alerts) with another person's outsideclaw agent without relying on external platforms.\n\n## Bundle format\n- `.tar.gz` containing:\n  - `manifest.json` (kind: `outsideclaw.route.bundle`)\n  - `route.geojson`\n  - `routepack.json`\n  - `meta.json`\n  - optional `alerts.json`\n\n## outsideclaw CLI workflow\nCreate bundle (sender):\n```bash\nnpm run share:route -- <routeId> [--alerts /path/to/alerts.json]\n```\n\nImport bundle (receiver):\n```bash\nnpm run import:bundle -- /path/to/outsideclaw-route-<routeId>-*.tar.gz\n```\n\n## Telegram workflow (planned)\n- `/share <routeId>` → bot replies with the `.tar.gz` file\n- Receiver forwards the file to their bot → bot auto-imports and replies with `/use <routeId>` instructions\n\nSecurity notes:\n- Validate `manifest.json.kind` before importing.\n- Extract only into a controlled directory.\n\nArchive v0.3.0: 19 files, 30553 bytes\n\nFiles: references/2bulu-notes.md (814b), references/gear-list-overnight.md (598b), references/guide-protocol.md (1740b), references/outsideclaw-integration.md (919b), references/qiniangshan_alerts.json (2153b), references/route-alerts.md (1481b), references/safety-checklist.md (746b), references/share-bundles.md (894b), scripts/generate_openclaw_snippet.js (722b), scripts/guide_route.js (16961b), scripts/guide_route.mjs (16961b), scripts/outsideclaw_setup.sh (1291b), scripts/parse_2bulu_kml.js (3109b), scripts/render_route_map_annotated.js (5423b), scripts/render_route_map.js (3098b), scripts/scrape_2bulu_tracks.js (2269b), scripts/weather_alert.js (5358b), SKILL.md (3407b), _meta.json (137b)\n\nFile v0.3.0:SKILL.md\n\n---\nname: trail-nav-telegram\ndescription: \"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KML route, (2) answers 'am I off-route / which way should I go' with low-token fixed outputs, (3) scrapes/publicly discovers route links from 2bulu track_search, and (4) prepares trip risk checklists + gear lists for an overnight hike.\"\n---\n\n# Trail Nav via Telegram (low-token)\n\n## Goals\n- Use Telegram (iOS) as the UI: user sends **location** + short commands.\n- Keep token usage minimal: do **all geometry calculations deterministically**, use LLM only for optional wording.\n- Respect access controls: **do not bypass logins/captchas** on external sites.\n\n## Quick workflow\n1) **Import route** (GPX/KML) → build a compact RoutePack (simplified polyline + bbox + endpoints).\n2) **Bind** route to the chat (`/use <routeId>`).\n3) **Guide**: user sends location (or `/g` + location) → reply with 2-line output (machine line + Chinese template).\n\n## Token-saving rules (hard)\n- Never send full KML/GPX text into the LLM context.\n- Parse route once; store `routeId` + simplified points.\n- Output is fixed schema (see references/guide-protocol.md).\n- Cache per-chat state: `activeRouteId`, `lastIdx`.\n\n## External discovery (2bulu)\nTwo supported modes:\n\n1) **Public discovery (no login)**\n- Only scrape **public list/search pages** (e.g. `/track/track_search.htm`, `/track/search-<keyword>.htm`).\n- Store: title + url + scraped_at.\n\n2) **Manual-login assist (optional)**\n- If the user manually logs in (WeChat/QQ/etc.) in a persistent browser profile, automation may proceed **within that same profile**.\n- Login/captcha steps must be completed by the user. Do **not** bypass access controls.\n\nPreferred alternative (often simplest): ask the user to export/send the **GPX/KML file via Telegram**; then operate purely on the user-provided route file.\n\n## Safety reminders\n- Provide explicit **no-signal** / SOS guidance. See references/safety-checklist.md.\n- Encourage “hard cutoffs” for overnight hikes (time, wind/fog, hydration).\n\n## Bundled resources\n- Scripts:\n  - `scripts/scrape_2bulu_tracks.js` list-page scraper → JSON/CSV + screenshot\n  - `scripts/parse_2bulu_kml.js` parse KML → stats + geojson + routepack\n  - `scripts/render_route_map.js` render route HTML+PNG map for sharing\n  - `scripts/render_route_map_annotated.js` render annotated map (GeoJSON + alerts) to HTML+PNG\n  - `scripts/guide_route.js` deterministic off-route guidance from GeoJSON + current location (outputs the 2-4 line guide protocol)\n  - `scripts/weather_alert.js` deterministic weather change alert (Open-Meteo) for day_hike/summit_camp/trail_run modes\n  - `scripts/outsideclaw_setup.sh` one-command install/update outsideclaw repo into ~/.outsideclaw/app/outsideclaw\n  - `scripts/generate_openclaw_snippet.js` prints an OpenClaw config snippet pointing to the installed outsideclaw skill\n- References:\n  - `references/2bulu-notes.md`\n  - `references/guide-protocol.md`\n  - `references/safety-checklist.md`\n  - `references/gear-list-overnight.md`\n  - `references/qiniangshan_alerts.json` risk-based key-node alerts (used for map annotations + alert triggering)\n  - `references/route-alerts.md` alerts schema + how to apply to any route\n  - `references/share-bundles.md` share route bundles between outsideclaw agents\n\nFile v0.3.0:_meta.json\n\n{\n  \"ownerId\": \"kn78xejze79zk1q8vrfhe4dk8n80nd6n\",\n  \"slug\": \"trail-nav-telegram\",\n  \"version\": \"0.3.0\",\n  \"publishedAt\": 1771261821045\n}\n\nFile v0.3.0:references/2bulu-notes.md\n\n# 2bulu notes (public scraping)\n\n## Useful pages\n- Track search/list: https://www.2bulu.com/track/track_search.htm\n- Keyword search results: https://www.2bulu.com/track/search-<urlencoded>.htm\n\n## What is safe to do\n- Scrape public list/search results: titles + URLs.\n- Treat as discovery links; store minimal metadata.\n\n## Manual login (allowed with user involvement)\n- Manual login is allowed: user completes WeChat/QQ login and any captcha in the browser.\n- Automation may continue **only in the same persisted browser profile**.\n\n## What to avoid\n- Do not bypass login/captcha.\n- Track-detail downloads may redirect to login; prefer user-exported GPX/KML sent via Telegram when possible.\n\n## Data quality\n- List page may contain duplicate links with query params (e.g. ?tabType=2). Normalize and de-duplicate.\n\nFile v0.3.0:references/gear-list-overnight.md\n\n# Gear list (2-person, 1-night ridge/summit camp)\n\n## Must\n- Shelter: tent + stakes + guylines\n- Sleep: sleeping bag (rated for windchill) + sleeping pad\n- Light: headlamp per person + spare power\n- Power: power bank\n- Clothing: wind/rain shell + insulation layer + spare base + hat + gloves\n- Safety: basic first-aid + emergency blanket + whistle\n- Water: assume no refill; carry enough\n- Food: dinner + breakfast + trail snacks + 20% buffer\n\n## Strongly recommended\n- Extra guylines, stronger stakes, tape/zip ties\n- Electrolytes\n- Trekking poles\n\n## Optional\n- Knee support, camp light, sit pad\n\nFile v0.3.0:references/guide-protocol.md\n\n# Low-token guide protocol (Telegram)\n\nRoute ID used in examples: `qiniangshan_jinghua`\n\n## Route acquisition\n- Preferred: user exports/sends GPX/KML via Telegram → deterministic parsing.\n- Optional: user manually logs in to 2bulu in a persistent browser profile; automation may assist after login (no bypass).\n\n## Commands\n- `/use <routeId>` bind route to current chat.\n- `/g` guide once. Location-only message may be treated as `/g`.\n\n## Output (2-4 lines)\nLine 1 (machine):\n`G S:<0|1|2> D:<m> B:<deg><dir> GO:<m> IDX:<n>`\n\n- S: 0=on_route, 1=off_route, 2=arrived\n- D: distance to route (m)\n- B: bearing degrees + dir (N/NE/E/SE/S/SW/W/NW)\n- GO: recommended distance (m) to rejoin/advance\n- IDX: nearest point index (for incremental window search)\n\nLine 2 (Chinese template, deterministic):\n- on_route: `在路线内（偏离{D}米）。朝{dir}（{B}°）前进约{GO}米。`\n- off_route: `你已偏离路线约{D}米。请朝{dir}（{B}°）走约{GO}米回到路线。`\n- arrived: `你已接近终点（{D}米内）。建议在此附近确认营地/下撤方向。`\n\nLine 3 (optional alert, if near a key node):\n`ALERT <letter>: <message>`\n\nLine 4 (optional weather alert, if enabled and sharp change detected):\n`WX ALERT: <CODE> <brief>`\n\n## Defaults\n- toleranceM=50\n- arrivedM=60\n- lookaheadM=120\n- bboxGuardM=2000 (if far from bbox, return E:OUT_OF_BBOX)\n\n## Reference implementation\n- `scripts/guide_route.js`: given a GeoJSON LineString + (lat,lon) (+ optional lastIdx), prints the 2-3 line response.\n  - Add `--alerts references/<route>_alerts.json` to enable key-node alerts.\n  - Add `--state /tmp/guide_state.json --cooldown-sec 1800` to dedupe alerts.\n\n## Errors (single line)\n- `E:NO_ROUTE`\n- `E:OUT_OF_BBOX`\n- `E:GPS_BAD`\n\nFile v0.3.0:references/outsideclaw-integration.md\n\n# outsideclaw integration (via trail-nav-telegram skill)\n\nGoal: keep outsideclaw as the full repo/CLI, but make it easy to import into OpenClaw.\n\n## 1) Install/update outsideclaw repo\nRun:\n```bash\nbash scripts/outsideclaw_setup.sh\n```\n\nDefault install location:\n- `~/.outsideclaw/app/outsideclaw`\n\nThis also runs:\n- `npm install`\n- `npm run setup` (creates DB + routes dirs)\n\n## 2) Generate OpenClaw config snippet\n```bash\nnode scripts/generate_openclaw_snippet.js\n```\n\nCopy the JSON snippet into your OpenClaw config's `skills` list.\n\n## 3) Use outsideclaw CLI\nOnce installed:\n```bash\ncd ~/.outsideclaw/app/outsideclaw\nnpm run setup\nnpm run import:kml -- /path/to/route.kml\nnpm run import:gpx -- /path/to/route.gpx\nnpm run guide -- <routeId> <lat> <lon> --wx on --mode day_hike\n```\n\nNotes:\n- outsideclaw is local-first (DB defaults to `~/.outsideclaw/outsideclaw.sqlite`).\n- Do not bypass external site login/captcha.\n\nFile v0.3.0:references/qiniangshan_alerts.json\n\n{\n  \"routeId\": \"qiniangshan_jinghua\",\n  \"routeName\": \"七娘山精华线\",\n  \"version\": 1,\n  \"match\": {\n    \"radiusM\": 120,\n    \"note\": \"Trigger when user location is within radiusM of a node. Use a cooldown to avoid spam.\"\n  },\n  \"nodes\": [\n    {\n      \"id\": \"start-trailhead\",\n      \"kind\": \"trailhead\",\n      \"letter\": \"A\",\n      \"name\": \"起点/登山口（大榕树）\",\n      \"lat\": 22.531146,\n      \"lon\": 114.516312,\n      \"altM\": 9,\n      \"atDistanceM\": 0,\n      \"message\": \"到登山口：检查头灯/备用电、雨衣、风绳地钉、哨子；水量不足先补。设定报平安时间。\"\n    },\n    {\n      \"id\": \"steep-section\",\n      \"kind\": \"hazard\",\n      \"letter\": \"B\",\n      \"name\": \"最陡拉升段（约100m爬升70m）\",\n      \"lat\": 22.5196,\n      \"lon\": 114.5376,\n      \"atDistanceM\": 3830,\n      \"window\": {\n        \"fromM\": 3780,\n        \"toM\": 3884\n      },\n      \"message\": \"前方最陡拉升段：补能量/小口喝水；路湿或风大就慢走，注意滑倒与抽筋。\"\n    },\n    {\n      \"id\": \"highpoint\",\n      \"kind\": \"summit_or_ridge\",\n      \"letter\": \"C\",\n      \"name\": \"最高点/山脊风险区\",\n      \"lat\": 22.525039,\n      \"lon\": 114.543805,\n      \"altM\": 873,\n      \"atDistanceM\": 4894,\n      \"message\": \"到山脊/高点：阵风更强体感更冷，立刻加衣戴帽手套；雾大别贴崖边。若要过夜，选背风平整处并加固帐篷。\"\n    },\n    {\n      \"id\": \"descent-start\",\n      \"kind\": \"descent\",\n      \"letter\": \"D\",\n      \"name\": \"下撤开始（膝踝风险上升）\",\n      \"lat\": 22.526848,\n      \"lon\": 114.536725,\n      \"altM\": 479,\n      \"atDistanceM\": 5898,\n      \"message\": \"开始下撤：用登山杖、步子小别跳；注意膝盖/脚踝与碎石滑倒。天黑前确认头灯电量。\"\n    },\n    {\n      \"id\": \"end-busstop\",\n      \"kind\": \"finish\",\n      \"letter\": \"E\",\n      \"name\": \"终点（国家地质公园公交站附近）\",\n      \"lat\": 22.531152,\n      \"lon\": 114.523186,\n      \"altM\": 48,\n      \"atDistanceM\": 7863,\n      \"message\": \"到终点：立刻发报平安（含时间+状态+位置）。下撤结束也容易出事，别松懈。\"\n    }\n  ]\n}\n\nFile v0.3.0:references/route-alerts.md\n\n# Route alerts (key nodes) — schema + usage\n\nGoal: add **route-specific key-node reminders** (hazards / ridge / descent start / water / campsite) with **low-token** output.\n\n## Files\n- Alerts config: `references/<routeId>_alerts.json` (example: `qiniangshan_alerts.json`)\n- Guide script: `scripts/guide_route.js`\n\n## Alerts JSON schema (minimal)\n```json\n{\n  \"routeId\": \"your_route_id\",\n  \"routeName\": \"Human name\",\n  \"match\": { \"radiusM\": 120 },\n  \"nodes\": [\n    {\n      \"id\": \"unique-node-id\",\n      \"letter\": \"A\",\n      \"kind\": \"hazard|trailhead|summit_or_ridge|descent|finish|water|campsite|node\",\n      \"name\": \"Label shown on map\",\n      \"lat\": 0,\n      \"lon\": 0,\n      \"message\": \"Chinese reminder text\"\n    }\n  ]\n}\n```\n\nNotes:\n- `match.radiusM` is the trigger radius.\n- `letter` is used in `ALERT <letter>:` output and for map labels.\n- Add as many nodes as you want; keep messages short.\n\n## Using alerts with guide_route\n`guide_route.js` prints the standard 2-line guide output, and optionally a 3rd line:\n\n- `ALERT <letter>: <message>`\n\nExample:\n```bash\nnode scripts/guide_route.js route.geojson 22.53 114.52 123 \\\n  --alerts references/qiniangshan_alerts.json \\\n  --state out/alert_state.json \\\n  --cooldown-sec 900\n```\n\n## Cooldown (anti-spam)\n- Use `--state <path>` to persist per-node last-trigger timestamps.\n- Use `--cooldown-sec <n>` (default recommended: 900s).\n\n## Rendering annotated map\nUse `scripts/render_route_map_annotated.js` with the same alerts JSON.\n\nFile v0.3.0:references/safety-checklist.md\n\n# Overnight hike safety checklist (signal + SOS)\n\n## Signal reality\n- Do not assume full cellular coverage on the entire trail.\n\n## Pre-trip\n- Share itinerary with a trusted contact (start / camp / descend / finish check-ins + latest check-in time).\n- Enable iPhone Emergency SOS + emergency contacts.\n- Carry power bank + spare cables.\n- Bring whistle + headlamp.\n\n## During trip\n- Check-in at: trailhead, mid-trail, campsite set, start descent, trail end.\n- If signal weak: move to open ridge/clearing; try SMS/phone first.\n\n## If emergency\n- If signal: call 110/120; share coordinates + status + headcount.\n- If no signal: stay together; prioritize warmth/shelter; move to open area; use whistle (3 short bursts repeating) + headlamp flashes.\n\nFile v0.3.0:references/share-bundles.md\n\n# Share routes (outsideclaw bundles)\n\nGoal: share a route (and optional alerts) with another person's outsideclaw agent without relying on external platforms.\n\n## Bundle format\n- `.tar.gz` containing:\n  - `manifest.json` (kind: `outsideclaw.route.bundle`)\n  - `route.geojson`\n  - `routepack.json`\n  - `meta.json`\n  - optional `alerts.json`\n\n## outsideclaw CLI workflow\nCreate bundle (sender):\n```bash\nnpm run share:route -- <routeId> [--alerts /path/to/alerts.json]\n```\n\nImport bundle (receiver):\n```bash\nnpm run import:bundle -- /path/to/outsideclaw-route-<routeId>-*.tar.gz\n```\n\n## Telegram workflow (planned)\n- `/share <routeId>` → bot replies with the `.tar.gz` file\n- Receiver forwards the file to their bot → bot auto-imports and replies with `/use <routeId>` instructions\n\nSecurity notes:\n- Validate `manifest.json.kind` before importing.\n- Extract only into a controlled directory.\n\nArchive v0.2.1: 16 files, 28589 bytes\n\nFiles: references/2bulu-notes.md (814b), references/gear-list-overnight.md (598b), references/guide-protocol.md (1740b), references/qiniangshan_alerts.json (2153b), references/route-alerts.md (1481b), references/safety-checklist.md (746b), references/share-bundles.md (894b), scripts/guide_route.js (16961b), scripts/guide_route.mjs (16961b), scripts/parse_2bulu_kml.js (3109b), scripts/render_route_map_annotated.js (5423b), scripts/render_route_map.js (3098b), scripts/scrape_2bulu_tracks.js (2269b), scripts/weather_alert.js (5358b), SKILL.md (3169b), _meta.json (137b)\n\nFile v0.2.1:SKILL.md\n\n---\nname: trail-nav-telegram\ndescription: \"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KML route, (2) answers 'am I off-route / which way should I go' with low-token fixed outputs, (3) scrapes/publicly discovers route links from 2bulu track_search, and (4) prepares trip risk checklists + gear lists for an overnight hike.\"\n---\n\n# Trail Nav via Telegram (low-token)\n\n## Goals\n- Use Telegram (iOS) as the UI: user sends **location** + short commands.\n- Keep token usage minimal: do **all geometry calculations deterministically**, use LLM only for optional wording.\n- Respect access controls: **do not bypass logins/captchas** on external sites.\n\n## Quick workflow\n1) **Import route** (GPX/KML) → build a compact RoutePack (simplified polyline + bbox + endpoints).\n2) **Bind** route to the chat (`/use <routeId>`).\n3) **Guide**: user sends location (or `/g` + location) → reply with 2-line output (machine line + Chinese template).\n\n## Token-saving rules (hard)\n- Never send full KML/GPX text into the LLM context.\n- Parse route once; store `routeId` + simplified points.\n- Output is fixed schema (see references/guide-protocol.md).\n- Cache per-chat state: `activeRouteId`, `lastIdx`.\n\n## External discovery (2bulu)\nTwo supported modes:\n\n1) **Public discovery (no login)**\n- Only scrape **public list/search pages** (e.g. `/track/track_search.htm`, `/track/search-<keyword>.htm`).\n- Store: title + url + scraped_at.\n\n2) **Manual-login assist (optional)**\n- If the user manually logs in (WeChat/QQ/etc.) in a persistent browser profile, automation may proceed **within that same profile**.\n- Login/captcha steps must be completed by the user. Do **not** bypass access controls.\n\nPreferred alternative (often simplest): ask the user to export/send the **GPX/KML file via Telegram**; then operate purely on the user-provided route file.\n\n## Safety reminders\n- Provide explicit **no-signal** / SOS guidance. See references/safety-checklist.md.\n- Encourage “hard cutoffs” for overnight hikes (time, wind/fog, hydration).\n\n## Bundled resources\n- Scripts:\n  - `scripts/scrape_2bulu_tracks.js` list-page scraper → JSON/CSV + screenshot\n  - `scripts/parse_2bulu_kml.js` parse KML → stats + geojson + routepack\n  - `scripts/render_route_map.js` render route HTML+PNG map for sharing\n  - `scripts/render_route_map_annotated.js` render annotated map (GeoJSON + alerts) to HTML+PNG\n  - `scripts/guide_route.js` deterministic off-route guidance from GeoJSON + current location (outputs the 2-line guide protocol)\n  - `scripts/weather_alert.js` deterministic weather change alert (Open-Meteo) for day_hike/summit_camp/trail_run modes\n- References:\n  - `references/2bulu-notes.md`\n  - `references/guide-protocol.md`\n  - `references/safety-checklist.md`\n  - `references/gear-list-overnight.md`\n  - `references/qiniangshan_alerts.json` risk-based key-node alerts (used for map annotations + alert triggering)\n  - `references/route-alerts.md` alerts schema + how to apply to any route\n  - `references/share-bundles.md` share route bundles between outsideclaw agents\n\nFile v0.2.1:_meta.json\n\n{\n  \"ownerId\": \"kn78xejze79zk1q8vrfhe4dk8n80nd6n\",\n  \"slug\": \"trail-nav-telegram\",\n  \"version\": \"0.2.1\",\n  \"publishedAt\": 1771257370180\n}\n\nFile v0.2.1:references/2bulu-notes.md\n\n# 2bulu notes (public scraping)\n\n## Useful pages\n- Track search/list: https://www.2bulu.com/track/track_search.htm\n- Keyword search results: https://www.2bulu.com/track/search-<urlencoded>.htm\n\n## What is safe to do\n- Scrape public list/search results: titles + URLs.\n- Treat as discovery links; store minimal metadata.\n\n## Manual login (allowed with user involvement)\n- Manual login is allowed: user completes WeChat/QQ login and any captcha in the browser.\n- Automation may continue **only in the same persisted browser profile**.\n\n## What to avoid\n- Do not bypass login/captcha.\n- Track-detail downloads may redirect to login; prefer user-exported GPX/KML sent via Telegram when possible.\n\n## Data quality\n- List page may contain duplicate links with query params (e.g. ?tabType=2). Normalize and de-duplicate.\n\nFile v0.2.1:references/gear-list-overnight.md\n\n# Gear list (2-person, 1-night ridge/summit camp)\n\n## Must\n- Shelter: tent + stakes + guylines\n- Sleep: sleeping bag (rated for windchill) + sleeping pad\n- Light: headlamp per person + spare power\n- Power: power bank\n- Clothing: wind/rain shell + insulation layer + spare base + hat + gloves\n- Safety: basic first-aid + emergency blanket + whistle\n- Water: assume no refill; carry enough\n- Food: dinner + breakfast + trail snacks + 20% buffer\n\n## Strongly recommended\n- Extra guylines, stronger stakes, tape/zip ties\n- Electrolytes\n- Trekking poles\n\n## Optional\n- Knee support, camp light, sit pad\n\nFile v0.2.1:references/guide-protocol.md\n\n# Low-token guide protocol (Telegram)\n\nRoute ID used in examples: `qiniangshan_jinghua`\n\n## Route acquisition\n- Preferred: user exports/sends GPX/KML via Telegram → deterministic parsing.\n- Optional: user manually logs in to 2bulu in a persistent browser profile; automation may assist after login (no bypass).\n\n## Commands\n- `/use <routeId>` bind route to current chat.\n- `/g` guide once. Location-only message may be treated as `/g`.\n\n## Output (2-4 lines)\nLine 1 (machine):\n`G S:<0|1|2> D:<m> B:<deg><dir> GO:<m> IDX:<n>`\n\n- S: 0=on_route, 1=off_route, 2=arrived\n- D: distance to route (m)\n- B: bearing degrees + dir (N/NE/E/SE/S/SW/W/NW)\n- GO: recommended distance (m) to rejoin/advance\n- IDX: nearest point index (for incremental window search)\n\nLine 2 (Chinese template, deterministic):\n- on_route: `在路线内（偏离{D}米）。朝{dir}（{B}°）前进约{GO}米。`\n- off_route: `你已偏离路线约{D}米。请朝{dir}（{B}°）走约{GO}米回到路线。`\n- arrived: `你已接近终点（{D}米内）。建议在此附近确认营地/下撤方向。`\n\nLine 3 (optional alert, if near a key node):\n`ALERT <letter>: <message>`\n\nLine 4 (optional weather alert, if enabled and sharp change detected):\n`WX ALERT: <CODE> <brief>`\n\n## Defaults\n- toleranceM=50\n- arrivedM=60\n- lookaheadM=120\n- bboxGuardM=2000 (if far from bbox, return E:OUT_OF_BBOX)\n\n## Reference implementation\n- `scripts/guide_route.js`: given a GeoJSON LineString + (lat,lon) (+ optional lastIdx), prints the 2-3 line response.\n  - Add `--alerts references/<route>_alerts.json` to enable key-node alerts.\n  - Add `--state /tmp/guide_state.json --cooldown-sec 1800` to dedupe alerts.\n\n## Errors (single line)\n- `E:NO_ROUTE`\n- `E:OUT_OF_BBOX`\n- `E:GPS_BAD`\n\nFile v0.2.1:references/qiniangshan_alerts.json\n\n{\n  \"routeId\": \"qiniangshan_jinghua\",\n  \"routeName\": \"七娘山精华线\",\n  \"version\": 1,\n  \"match\": {\n    \"radiusM\": 120,\n    \"note\": \"Trigger when user location is within radiusM of a node. Use a cooldown to avoid spam.\"\n  },\n  \"nodes\": [\n    {\n      \"id\": \"start-trailhead\",\n      \"kind\": \"trailhead\",\n      \"letter\": \"A\",\n      \"name\": \"起点/登山口（大榕树）\",\n      \"lat\": 22.531146,\n      \"lon\": 114.516312,\n      \"altM\": 9,\n      \"atDistanceM\": 0,\n      \"message\": \"到登山口：检查头灯/备用电、雨衣、风绳地钉、哨子；水量不足先补。设定报平安时间。\"\n    },\n    {\n      \"id\": \"steep-section\",\n      \"kind\": \"hazard\",\n      \"letter\": \"B\",\n      \"name\": \"最陡拉升段（约100m爬升70m）\",\n      \"lat\": 22.5196,\n      \"lon\": 114.5376,\n      \"atDistanceM\": 3830,\n      \"window\": {\n        \"fromM\": 3780,\n        \"toM\": 3884\n      },\n      \"message\": \"前方最陡拉升段：补能量/小口喝水；路湿或风大就慢走，注意滑倒与抽筋。\"\n    },\n    {\n      \"id\": \"highpoint\",\n      \"kind\": \"summit_or_ridge\",\n      \"letter\": \"C\",\n      \"name\": \"最高点/山脊风险区\",\n      \"lat\": 22.525039,\n      \"lon\": 114.543805,\n      \"altM\": 873,\n      \"atDistanceM\": 4894,\n      \"message\": \"到山脊/高点：阵风更强体感更冷，立刻加衣戴帽手套；雾大别贴崖边。若要过夜，选背风平整处并加固帐篷。\"\n    },\n    {\n      \"id\": \"descent-start\",\n      \"kind\": \"descent\",\n      \"letter\": \"D\",\n      \"name\": \"下撤开始（膝踝风险上升）\",\n      \"lat\": 22.526848,\n      \"lon\": 114.536725,\n      \"altM\": 479,\n      \"atDistanceM\": 5898,\n      \"message\": \"开始下撤：用登山杖、步子小别跳；注意膝盖/脚踝与碎石滑倒。天黑前确认头灯电量。\"\n    },\n    {\n      \"id\": \"end-busstop\",\n      \"kind\": \"finish\",\n      \"letter\": \"E\",\n      \"name\": \"终点（国家地质公园公交站附近）\",\n      \"lat\": 22.531152,\n      \"lon\": 114.523186,\n      \"altM\": 48,\n      \"atDistanceM\": 7863,\n      \"message\": \"到终点：立刻发报平安（含时间+状态+位置）。下撤结束也容易出事，别松懈。\"\n    }\n  ]\n}\n\nFile v0.2.1:references/route-alerts.md\n\n# Route alerts (key nodes) — schema + usage\n\nGoal: add **route-specific key-node reminders** (hazards / ridge / descent start / water / campsite) with **low-token** output.\n\n## Files\n- Alerts config: `references/<routeId>_alerts.json` (example: `qiniangshan_alerts.json`)\n- Guide script: `scripts/guide_route.js`\n\n## Alerts JSON schema (minimal)\n```json\n{\n  \"routeId\": \"your_route_id\",\n  \"routeName\": \"Human name\",\n  \"match\": { \"radiusM\": 120 },\n  \"nodes\": [\n    {\n      \"id\": \"unique-node-id\",\n      \"letter\": \"A\",\n      \"kind\": \"hazard|trailhead|summit_or_ridge|descent|finish|water|campsite|node\",\n      \"name\": \"Label shown on map\",\n      \"lat\": 0,\n      \"lon\": 0,\n      \"message\": \"Chinese reminder text\"\n    }\n  ]\n}\n```\n\nNotes:\n- `match.radiusM` is the trigger radius.\n- `letter` is used in `ALERT <letter>:` output and for map labels.\n- Add as many nodes as you want; keep messages short.\n\n## Using alerts with guide_route\n`guide_route.js` prints the standard 2-line guide output, and optionally a 3rd line:\n\n- `ALERT <letter>: <message>`\n\nExample:\n```bash\nnode scripts/guide_route.js route.geojson 22.53 114.52 123 \\\n  --alerts references/qiniangshan_alerts.json \\\n  --state out/alert_state.json \\\n  --cooldown-sec 900\n```\n\n## Cooldown (anti-spam)\n- Use `--state <path>` to persist per-node last-trigger timestamps.\n- Use `--cooldown-sec <n>` (default recommended: 900s).\n\n## Rendering annotated map\nUse `scripts/render_route_map_annotated.js` with the same alerts JSON.\n\nFile v0.2.1:references/safety-checklist.md\n\n# Overnight hike safety checklist (signal + SOS)\n\n## Signal reality\n- Do not assume full cellular coverage on the entire trail.\n\n## Pre-trip\n- Share itinerary with a trusted contact (start / camp / descend / finish check-ins + latest check-in time).\n- Enable iPhone Emergency SOS + emergency contacts.\n- Carry power bank + spare cables.\n- Bring whistle + headlamp.\n\n## During trip\n- Check-in at: trailhead, mid-trail, campsite set, start descent, trail end.\n- If signal weak: move to open ridge/clearing; try SMS/phone first.\n\n## If emergency\n- If signal: call 110/120; share coordinates + status + headcount.\n- If no signal: stay together; prioritize warmth/shelter; move to open area; use whistle (3 short bursts repeating) + headlamp flashes.\n\nFile v0.2.1:references/share-bundles.md\n\n# Share routes (outsideclaw bundles)\n\nGoal: share a route (and optional alerts) with another person's outsideclaw agent without relying on external platforms.\n\n## Bundle format\n- `.tar.gz` containing:\n  - `manifest.json` (kind: `outsideclaw.route.bundle`)\n  - `route.geojson`\n  - `routepack.json`\n  - `meta.json`\n  - optional `alerts.json`\n\n## outsideclaw CLI workflow\nCreate bundle (sender):\n```bash\nnpm run share:route -- <routeId> [--alerts /path/to/alerts.json]\n```\n\nImport bundle (receiver):\n```bash\nnpm run import:bundle -- /path/to/outsideclaw-route-<routeId>-*.tar.gz\n```\n\n## Telegram workflow (planned)\n- `/share <routeId>` → bot replies with the `.tar.gz` file\n- Receiver forwards the file to their bot → bot auto-imports and replies with `/use <routeId>` instructions\n\nSecurity notes:\n- Validate `manifest.json.kind` before importing.\n- Extract only into a controlled directory.\n\nArchive v0.2.0: 17 files, 60657 bytes\n\nFiles: out/alert_state.json (53b), out/route_map_annotated.html (164647b), out/wx_cache.json (202b), references/2bulu-notes.md (814b), references/gear-list-overnight.md (598b), references/guide-protocol.md (1740b), references/qiniangshan_alerts.json (2153b), references/route-alerts.md (1481b), references/safety-checklist.md (746b), scripts/guide_route.js (16961b), scripts/parse_2bulu_kml.js (3109b), scripts/render_route_map_annotated.js (5423b), scripts/render_route_map.js (3098b), scripts/scrape_2bulu_tracks.js (2269b), scripts/weather_alert.js (5358b), SKILL.md (3088b), _meta.json (137b)\n\nFile v0.2.0:SKILL.md\n\n---\nname: trail-nav-telegram\ndescription: \"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KML route, (2) answers 'am I off-route / which way should I go' with low-token fixed outputs, (3) scrapes/publicly discovers route links from 2bulu track_search, and (4) prepares trip risk checklists + gear lists for an overnight hike.\"\n---\n\n# Trail Nav via Telegram (low-token)\n\n## Goals\n- Use Telegram (iOS) as the UI: user sends **location** + short commands.\n- Keep token usage minimal: do **all geometry calculations deterministically**, use LLM only for optional wording.\n- Respect access controls: **do not bypass logins/captchas** on external sites.\n\n## Quick workflow\n1) **Import route** (GPX/KML) → build a compact RoutePack (simplified polyline + bbox + endpoints).\n2) **Bind** route to the chat (`/use <routeId>`).\n3) **Guide**: user sends location (or `/g` + location) → reply with 2-line output (machine line + Chinese template).\n\n## Token-saving rules (hard)\n- Never send full KML/GPX text into the LLM context.\n- Parse route once; store `routeId` + simplified points.\n- Output is fixed schema (see references/guide-protocol.md).\n- Cache per-chat state: `activeRouteId`, `lastIdx`.\n\n## External discovery (2bulu)\nTwo supported modes:\n\n1) **Public discovery (no login)**\n- Only scrape **public list/search pages** (e.g. `/track/track_search.htm`, `/track/search-<keyword>.htm`).\n- Store: title + url + scraped_at.\n\n2) **Manual-login assist (optional)**\n- If the user manually logs in (WeChat/QQ/etc.) in a persistent browser profile, automation may proceed **within that same profile**.\n- Login/captcha steps must be completed by the user. Do **not** bypass access controls.\n\nPreferred alternative (often simplest): ask the user to export/send the **GPX/KML file via Telegram**; then operate purely on the user-provided route file.\n\n## Safety reminders\n- Provide explicit **no-signal** / SOS guidance. See references/safety-checklist.md.\n- Encourage “hard cutoffs” for overnight hikes (time, wind/fog, hydration).\n\n## Bundled resources\n- Scripts:\n  - `scripts/scrape_2bulu_tracks.js` list-page scraper → JSON/CSV + screenshot\n  - `scripts/parse_2bulu_kml.js` parse KML → stats + geojson + routepack\n  - `scripts/render_route_map.js` render route HTML+PNG map for sharing\n  - `scripts/render_route_map_annotated.js` render annotated map (GeoJSON + alerts) to HTML+PNG\n  - `scripts/guide_route.js` deterministic off-route guidance from GeoJSON + current location (outputs the 2-line guide protocol)\n  - `scripts/weather_alert.js` deterministic weather change alert (Open-Meteo) for day_hike/summit_camp/trail_run modes\n- References:\n  - `references/2bulu-notes.md`\n  - `references/guide-protocol.md`\n  - `references/safety-checklist.md`\n  - `references/gear-list-overnight.md`\n  - `references/qiniangshan_alerts.json` risk-based key-node alerts (used for map annotations + alert triggering)\n  - `references/route-alerts.md` alerts schema + how to apply to any route\n\nFile v0.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn78xejze79zk1q8vrfhe4dk8n80nd6n\",\n  \"slug\": \"trail-nav-telegram\",\n  \"version\": \"0.2.0\",\n  \"publishedAt\": 1771251919479\n}\n\nFile v0.2.0:references/2bulu-notes.md\n\n# 2bulu notes (public scraping)\n\n## Useful pages\n- Track search/list: https://www.2bulu.com/track/track_search.htm\n- Keyword search results: https://www.2bulu.com/track/search-<urlencoded>.htm\n\n## What is safe to do\n- Scrape public list/search results: titles + URLs.\n- Treat as discovery links; store minimal metadata.\n\n## Manual login (allowed with user involvement)\n- Manual login is allowed: user completes WeChat/QQ login and any captcha in the browser.\n- Automation may continue **only in the same persisted browser profile**.\n\n## What to avoid\n- Do not bypass login/captcha.\n- Track-detail downloads may redirect to login; prefer user-exported GPX/KML sent via Telegram when possible.\n\n## Data quality\n- List page may contain duplicate links with query params (e.g. ?tabType=2). Normalize and de-duplicate.\n\nFile v0.2.0:references/gear-list-overnight.md\n\n# Gear list (2-person, 1-night ridge/summit camp)\n\n## Must\n- Shelter: tent + stakes + guylines\n- Sleep: sleeping bag (rated for windchill) + sleeping pad\n- Light: headlamp per person + spare power\n- Power: power bank\n- Clothing: wind/rain shell + insulation layer + spare base + hat + gloves\n- Safety: basic first-aid + emergency blanket + whistle\n- Water: assume no refill; carry enough\n- Food: dinner + breakfast + trail snacks + 20% buffer\n\n## Strongly recommended\n- Extra guylines, stronger stakes, tape/zip ties\n- Electrolytes\n- Trekking poles\n\n## Optional\n- Knee support, camp light, sit pad\n\nFile v0.2.0:references/guide-protocol.md\n\n# Low-token guide protocol (Telegram)\n\nRoute ID used in examples: `qiniangshan_jinghua`\n\n## Route acquisition\n- Preferred: user exports/sends GPX/KML via Telegram → deterministic parsing.\n- Optional: user manually logs in to 2bulu in a persistent browser profile; automation may assist after login (no bypass).\n\n## Commands\n- `/use <routeId>` bind route to current chat.\n- `/g` guide once. Location-only message may be treated as `/g`.\n\n## Output (2-4 lines)\nLine 1 (machine):\n`G S:<0|1|2> D:<m> B:<deg><dir> GO:<m> IDX:<n>`\n\n- S: 0=on_route, 1=off_route, 2=arrived\n- D: distance to route (m)\n- B: bearing degrees + dir (N/NE/E/SE/S/SW/W/NW)\n- GO: recommended distance (m) to rejoin/advance\n- IDX: nearest point index (for incremental window search)\n\nLine 2 (Chinese template, deterministic):\n- on_route: `在路线内（偏离{D}米）。朝{dir}（{B}°）前进约{GO}米。`\n- off_route: `你已偏离路线约{D}米。请朝{dir}（{B}°）走约{GO}米回到路线。`\n- arrived: `你已接近终点（{D}米内）。建议在此附近确认营地/下撤方向。`\n\nLine 3 (optional alert, if near a key node):\n`ALERT <letter>: <message>`\n\nLine 4 (optional weather alert, if enabled and sharp change detected):\n`WX ALERT: <CODE> <brief>`\n\n## Defaults\n- toleranceM=50\n- arrivedM=60\n- lookaheadM=120\n- bboxGuardM=2000 (if far from bbox, return E:OUT_OF_BBOX)\n\n## Reference implementation\n- `scripts/guide_route.js`: given a GeoJSON LineString + (lat,lon) (+ optional lastIdx), prints the 2-3 line response.\n  - Add `--alerts references/<route>_alerts.json` to enable key-node alerts.\n  - Add `--state /tmp/guide_state.json --cooldown-sec 1800` to dedupe alerts.\n\n## Errors (single line)\n- `E:NO_ROUTE`\n- `E:OUT_OF_BBOX`\n- `E:GPS_BAD`\n\nFile v0.2.0:references/qiniangshan_alerts.json\n\n{\n  \"routeId\": \"qiniangshan_jinghua\",\n  \"routeName\": \"七娘山精华线\",\n  \"version\": 1,\n  \"match\": {\n    \"radiusM\": 120,\n    \"note\": \"Trigger when user location is within radiusM of a node. Use a cooldown to avoid spam.\"\n  },\n  \"nodes\": [\n    {\n      \"id\": \"start-trailhead\",\n      \"kind\": \"trailhead\",\n      \"letter\": \"A\",\n      \"name\": \"起点/登山口（大榕树）\",\n      \"lat\": 22.531146,\n      \"lon\": 114.516312,\n      \"altM\": 9,\n      \"atDistanceM\": 0,\n      \"message\": \"到登山口：检查头灯/备用电、雨衣、风绳地钉、哨子；水量不足先补。设定报平安时间。\"\n    },\n    {\n      \"id\": \"steep-section\",\n      \"kind\": \"hazard\",\n      \"letter\": \"B\",\n      \"name\": \"最陡拉升段（约100m爬升70m）\",\n      \"lat\": 22.5196,\n      \"lon\": 114.5376,\n      \"atDistanceM\": 3830,\n      \"window\": {\n        \"fromM\": 3780,\n        \"toM\": 3884\n      },\n      \"message\": \"前方最陡拉升段：补能量/小口喝水；路湿或风大就慢走，注意滑倒与抽筋。\"\n    },\n    {\n      \"id\": \"highpoint\",\n      \"kind\": \"summit_or_ridge\",\n      \"letter\": \"C\",\n      \"name\": \"最高点/山脊风险区\",\n      \"lat\": 22.525039,\n      \"lon\": 114.543805,\n      \"altM\": 873,\n      \"atDistanceM\": 4894,\n      \"message\": \"到山脊/高点：阵风更强体感更冷，立刻加衣戴帽手套；雾大别贴崖边。若要过夜，选背风平整处并加固帐篷。\"\n    },\n    {\n      \"id\": \"descent-start\",\n      \"kind\": \"descent\",\n      \"letter\": \"D\",\n      \"name\": \"下撤开始（膝踝风险上升）\",\n      \"lat\": 22.526848,\n      \"lon\": 114.536725,\n      \"altM\": 479,\n      \"atDistanceM\": 5898,\n      \"message\": \"开始下撤：用登山杖、步子小别跳；注意膝盖/脚踝与碎石滑倒。天黑前确认头灯电量。\"\n    },\n    {\n      \"id\": \"end-busstop\",\n      \"kind\": \"finish\",\n      \"letter\": \"E\",\n      \"name\": \"终点（国家地质公园公交站附近）\",\n      \"lat\": 22.531152,\n      \"lon\": 114.523186,\n      \"altM\": 48,\n      \"atDistanceM\": 7863,\n      \"message\": \"到终点：立刻发报平安（含时间+状态+位置）。下撤结束也容易出事，别松懈。\"\n    }\n  ]\n}\n\nFile v0.2.0:references/route-alerts.md\n\n# Route alerts (key nodes) — schema + usage\n\nGoal: add **route-specific key-node reminders** (hazards / ridge / descent start / water / campsite) with **low-token** output.\n\n## Files\n- Alerts config: `references/<routeId>_alerts.json` (example: `qiniangshan_alerts.json`)\n- Guide script: `scripts/guide_route.js`\n\n## Alerts JSON schema (minimal)\n```json\n{\n  \"routeId\": \"your_route_id\",\n  \"routeName\": \"Human name\",\n  \"match\": { \"radiusM\": 120 },\n  \"nodes\": [\n    {\n      \"id\": \"unique-node-id\",\n      \"letter\": \"A\",\n      \"kind\": \"hazard|trailhead|summit_or_ridge|descent|finish|water|campsite|node\",\n      \"name\": \"Label shown on map\",\n      \"lat\": 0,\n      \"lon\": 0,\n      \"message\": \"Chinese reminder text\"\n    }\n  ]\n}\n```\n\nNotes:\n- `match.radiusM` is the trigger radius.\n- `letter` is used in `ALERT <letter>:` output and for map labels.\n- Add as many nodes as you want; keep messages short.\n\n## Using alerts with guide_route\n`guide_route.js` prints the standard 2-line guide output, and optionally a 3rd line:\n\n- `ALERT <letter>: <message>`\n\nExample:\n```bash\nnode scripts/guide_route.js route.geojson 22.53 114.52 123 \\\n  --alerts references/qiniangshan_alerts.json \\\n  --state out/alert_state.json \\\n  --cooldown-sec 900\n```\n\n## Cooldown (anti-spam)\n- Use `--state <path>` to persist per-node last-trigger timestamps.\n- Use `--cooldown-sec <n>` (default recommended: 900s).\n\n## Rendering annotated map\nUse `scripts/render_route_map_annotated.js` with the same alerts JSON.\n\nFile v0.2.0:references/safety-checklist.md\n\n# Overnight hike safety checklist (signal + SOS)\n\n## Signal reality\n- Do not assume full cellular coverage on the entire trail.\n\n## Pre-trip\n- Share itinerary with a trusted contact (start / camp / descend / finish check-ins + latest check-in time).\n- Enable iPhone Emergency SOS + emergency contacts.\n- Carry power bank + spare cables.\n- Bring whistle + headlamp.\n\n## During trip\n- Check-in at: trailhead, mid-trail, campsite set, start descent, trail end.\n- If signal weak: move to open ridge/clearing; try SMS/phone first.\n\n## If emergency\n- If signal: call 110/120; share coordinates + status + headcount.\n- If no signal: stay together; prioritize warmth/shelter; move to open area; use whistle (3 short bursts repeating) + headlamp flashes.\n\nFile v0.2.0:out/alert_state.json\n\n{\n  \"last\": {\n    \"start-trailhead\": 1771251835\n  }\n}\n\nFile v0.2.0:out/wx_cache.json\n\n{\n  \"key\": \"22.53115,114.51631|day_hike|Asia/Shanghai|3\",\n  \"at\": 1771251835,\n  \"line\": \"WX ALERT: VIS_DOWN -14km in 2h\",\n  \"sample\": {\n    \"lat\": 22.531146,\n    \"lon\": 114.516312,\n    \"why\": \"me\"\n  }\n}\n\nArchive v0.1.0: 9 files, 8799 bytes\n\nFiles: references/2bulu-notes.md (814b), references/gear-list-overnight.md (598b), references/guide-protocol.md (1262b), references/safety-checklist.md (746b), scripts/parse_2bulu_kml.js (3109b), scripts/render_route_map.js (3098b), scripts/scrape_2bulu_tracks.js (2269b), SKILL.md (2553b), _meta.json (137b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: trail-nav-telegram\ndescription: \"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KML route, (2) answers 'am I off-route / which way should I go' with low-token fixed outputs, (3) scrapes/publicly discovers route links from 2bulu track_search, and (4) prepares trip risk checklists + gear lists for an overnight hike.\"\n---\n\n# Trail Nav via Telegram (low-token)\n\n## Goals\n- Use Telegram (iOS) as the UI: user sends **location** + short commands.\n- Keep token usage minimal: do **all geometry calculations deterministically**, use LLM only for optional wording.\n- Respect access controls: **do not bypass logins/captchas** on external sites.\n\n## Quick workflow\n1) **Import route** (GPX/KML) → build a compact RoutePack (simplified polyline + bbox + endpoints).\n2) **Bind** route to the chat (`/use <routeId>`).\n3) **Guide**: user sends location (or `/g` + location) → reply with 2-line output (machine line + Chinese template).\n\n## Token-saving rules (hard)\n- Never send full KML/GPX text into the LLM context.\n- Parse route once; store `routeId` + simplified points.\n- Output is fixed schema (see references/guide-protocol.md).\n- Cache per-chat state: `activeRouteId`, `lastIdx`.\n\n## External discovery (2bulu)\nTwo supported modes:\n\n1) **Public discovery (no login)**\n- Only scrape **public list/search pages** (e.g. `/track/track_search.htm`, `/track/search-<keyword>.htm`).\n- Store: title + url + scraped_at.\n\n2) **Manual-login assist (optional)**\n- If the user manually logs in (WeChat/QQ/etc.) in a persistent browser profile, automation may proceed **within that same profile**.\n- Login/captcha steps must be completed by the user. Do **not** bypass access controls.\n\nPreferred alternative (often simplest): ask the user to export/send the **GPX/KML file via Telegram**; then operate purely on the user-provided route file.\n\n## Safety reminders\n- Provide explicit **no-signal** / SOS guidance. See references/safety-checklist.md.\n- Encourage “hard cutoffs” for overnight hikes (time, wind/fog, hydration).\n\n## Bundled resources\n- Scripts:\n  - `scripts/scrape_2bulu_tracks.js` list-page scraper → JSON/CSV + screenshot\n  - `scripts/parse_2bulu_kml.js` parse KML → stats + geojson + routepack\n  - `scripts/render_route_map.js` render route HTML+PNG map for sharing\n- References:\n  - `references/2bulu-notes.md`\n  - `references/guide-protocol.md`\n  - `references/safety-checklist.md`\n  - `references/gear-list-overnight.md`\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn78xejze79zk1q8vrfhe4dk8n80nd6n\",\n  \"slug\": \"trail-nav-telegram\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1771236075053\n}\n\nFile v0.1.0:references/2bulu-notes.md\n\n# 2bulu notes (public scraping)\n\n## Useful pages\n- Track search/list: https://www.2bulu.com/track/track_search.htm\n- Keyword search results: https://www.2bulu.com/track/search-<urlencoded>.htm\n\n## What is safe to do\n- Scrape public list/search results: titles + URLs.\n- Treat as discovery links; store minimal metadata.\n\n## Manual login (allowed with user involvement)\n- Manual login is allowed: user completes WeChat/QQ login and any captcha in the browser.\n- Automation may continue **only in the same persisted browser profile**.\n\n## What to avoid\n- Do not bypass login/captcha.\n- Track-detail downloads may redirect to login; prefer user-exported GPX/KML sent via Telegram when possible.\n\n## Data quality\n- List page may contain duplicate links with query params (e.g. ?tabType=2). Normalize and de-duplicate.\n\nFile v0.1.0:references/gear-list-overnight.md\n\n# Gear list (2-person, 1-night ridge/summit camp)\n\n## Must\n- Shelter: tent + stakes + guylines\n- Sleep: sleeping bag (rated for windchill) + sleeping pad\n- Light: headlamp per person + spare power\n- Power: power bank\n- Clothing: wind/rain shell + insulation layer + spare base + hat + gloves\n- Safety: basic first-aid + emergency blanket + whistle\n- Water: assume no refill; carry enough\n- Food: dinner + breakfast + trail snacks + 20% buffer\n\n## Strongly recommended\n- Extra guylines, stronger stakes, tape/zip ties\n- Electrolytes\n- Trekking poles\n\n## Optional\n- Knee support, camp light, sit pad\n\nFile v0.1.0:references/guide-protocol.md\n\n# Low-token guide protocol (Telegram)\n\nRoute ID used in examples: `qiniangshan_jinghua`\n\n## Route acquisition\n- Preferred: user exports/sends GPX/KML via Telegram → deterministic parsing.\n- Optional: user manually logs in to 2bulu in a persistent browser profile; automation may assist after login (no bypass).\n\n## Commands\n- `/use <routeId>` bind route to current chat.\n- `/g` guide once. Location-only message may be treated as `/g`.\n\n## Output (2 lines)\nLine 1 (machine):\n`G S:<0|1|2> D:<m> B:<deg><dir> GO:<m> IDX:<n>`\n\n- S: 0=on_route, 1=off_route, 2=arrived\n- D: distance to route (m)\n- B: bearing degrees + dir (N/NE/E/SE/S/SW/W/NW)\n- GO: recommended distance (m) to rejoin/advance\n- IDX: nearest point index (for incremental window search)\n\nLine 2 (Chinese template, deterministic):\n- on_route: `在路线内（偏离{D}米）。朝{dir}（{B}°）前进约{GO}米。`\n- off_route: `你已偏离路线约{D}米。请朝{dir}（{B}°）走约{GO}米回到路线。`\n- arrived: `你已接近终点（{D}米内）。建议在此附近确认营地/下撤方向。`\n\n## Defaults\n- toleranceM=50\n- arrivedM=60\n- lookaheadM=120\n- bboxGuardM=2000 (if far from bbox, return E:OUT_OF_BBOX)\n\n## Errors (single line)\n- `E:NO_ROUTE`\n- `E:OUT_OF_BBOX`\n- `E:GPS_BAD`\n\nFile v0.1.0:references/safety-checklist.md\n\n# Overnight hike safety checklist (signal + SOS)\n\n## Signal reality\n- Do not assume full cellular coverage on the entire trail.\n\n## Pre-trip\n- Share itinerary with a trusted contact (start / camp / descend / finish check-ins + latest check-in time).\n- Enable iPhone Emergency SOS + emergency contacts.\n- Carry power bank + spare cables.\n- Bring whistle + headlamp.\n\n## During trip\n- Check-in at: trailhead, mid-trail, campsite set, start descent, trail end.\n- If signal weak: move to open ridge/clearing; try SMS/phone first.\n\n## If emergency\n- If signal: call 110/120; share coordinates + status + headcount.\n- If no signal: stay together; prioritize warmth/shelter; move to open area; use whistle (3 short bursts repeating) + headlamp flashes.","readmeExcerpt":"Skill: Trail Nav via Telegram (low-token) Owner: jack4world Summary: Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KM... Tags: latest:0.3.2 Version history: v0.3.2 | 2026-02-21T17:08:00.122Z | user Fix one-click OpenClaw config patcher to use new skills schema (skills.load.extraDirs + skills.entries), with leg","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"bash scripts/openclaw_oneclick_setup.sh --config /path/to/openclaw.config.json --restart"},{"language":"bash","snippet":"bash scripts/outsideclaw_setup.sh"},{"language":"bash","snippet":"node scripts/generate_openclaw_snippet.js"},{"language":"bash","snippet":"cd ~/.outsideclaw/app/outsideclaw\nnpm run setup\nnpm run import:kml -- /path/to/route.kml\nnpm run import:gpx -- /path/to/route.gpx\nnpm run guide -- <routeId> <lat> <lon> --wx on --mode day_hike"},{"language":"json","snippet":"{\n  \"routeId\": \"your_route_id\",\n  \"routeName\": \"Human name\",\n  \"match\": { \"radiusM\": 120 },\n  \"nodes\": [\n    {\n      \"id\": \"unique-node-id\",\n      \"letter\": \"A\",\n      \"kind\": \"hazard|trailhead|summit_or_ridge|descent|finish|water|campsite|node\",\n      \"name\": \"Label shown on map\",\n      \"lat\": 0,\n      \"lon\": 0,\n      \"message\": \"Chinese reminder text\"\n    }\n  ]\n}"},{"language":"bash","snippet":"node scripts/guide_route.js route.geojson 22.53 114.52 123 \\\n  --alerts references/qiniangshan_alerts.json \\\n  --state out/alert_state.json \\\n  --cooldown-sec 900"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: trail-nav-telegram\ndescription: \"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KML route, (2) answers 'am I off-route / which way should I go' with low-token fixed outputs, (3) scrapes/publicly discovers route links from 2bulu track_search, and (4) prepares trip risk checklists + gear lists for an overnight hike.\"\n---\n\n# Trail Nav via Telegram (low-token)\n\n## Goals\n- Use Telegram (iOS) as the UI: user sends **location** + short commands.\n- Keep token usage minimal: do **all geometry calculations deterministically**, use LLM only for optional wording.\n- Respect access controls: **do not bypass logins/captchas** on external sites.\n\n## Quick workflow\n1) **Import route** (GPX/KML) → build a compact RoutePack (simplified polyline + bbox + endpoints).\n2) **Bind** route to the chat (`/use <routeId>`).\n3) **Guide**: user sends location (or `/g` + location) → reply with 2-line output (machine line + Chinese template).\n\n## Token-saving rules (hard)\n- Never send full KML/GPX text into the LLM context.\n- Parse route once; store `routeId` + simplified points.\n- Output is fixed schema (see references/guide-protocol.md).\n- Cache per-chat state: `activeRouteId`, `lastIdx`.\n\n## External discovery (2bulu)\nTwo supported modes:\n\n1) **Public discovery (no login)**\n- Only scrape **public list/search pages** (e.g. `/track/track_search.htm`, `/track/search-<keyword>.htm`).\n- Store: title + url + scraped_at.\n\n2) **Manual-login assist (optional)**\n- If the user manually logs in (WeChat/QQ/etc.) in a persistent browser profile, automation may proceed **within that same profile**.\n- Login/captcha steps must be completed by the user. Do **not** bypass access controls.\n\nPreferred alternative (often simplest): ask the user to export/send the **GPX/KML file via Telegram**; then operate purely on the user-provided route file.\n\n## Safety reminders\n- Provide explicit **no-signal** / SOS guidance. See references/safety-checklist.md.\n- Encourage “hard cutoffs” for overnight hikes (time, wind/fog, hydration).\n\n## Bundled resources\n- Scripts:\n  - `scripts/scrape_2bulu_tracks.js` list-page scraper → JSON/CSV + screenshot\n  - `scripts/parse_2bulu_kml.js` parse KML → stats + geojson + routepack\n  - `scripts/render_route_map.js` render route HTML+PNG map for sharing\n  - `scripts/render_route_map_annotated.js` render annotated map (GeoJSON + alerts) to HTML+PNG\n  - `scripts/guide_route.js` deterministic off-route guidance from GeoJSON + current location (outputs the 2-4 line guide protocol)\n  - `scripts/weather_alert.js` deterministic weather change alert (Open-Meteo) for day_hike/summit_camp/trail_run modes\n  - `scripts/outsideclaw_setup.sh` one-command install/update outsideclaw repo into ~/.outsideclaw/app/outsideclaw\n  - `scripts/generate_openclaw_snippet.js` prints an OpenClaw config snippet pointing to the installed outsideclaw skill\n  - `scripts/patch_openclaw_confi"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn78xejze79zk1q8vrfhe4dk8n80nd6n\",\n  \"slug\": \"trail-nav-telegram\",\n  \"version\": \"0.3.2\",\n  \"publishedAt\": 1771693680122\n}"},{"path":"references/2bulu-notes.md","content":"# 2bulu notes (public scraping)\n\n## Useful pages\n- Track search/list: https://www.2bulu.com/track/track_search.htm\n- Keyword search results: https://www.2bulu.com/track/search-<urlencoded>.htm\n\n## What is safe to do\n- Scrape public list/search results: titles + URLs.\n- Treat as discovery links; store minimal metadata.\n\n## Manual login (allowed with user involvement)\n- Manual login is allowed: user completes WeChat/QQ login and any captcha in the browser.\n- Automation may continue **only in the same persisted browser profile**.\n\n## What to avoid\n- Do not bypass login/captcha.\n- Track-detail downloads may redirect to login; prefer user-exported GPX/KML sent via Telegram when possible.\n\n## Data quality\n- List page may contain duplicate links with query params (e.g. ?tabType=2). Normalize and de-duplicate."},{"path":"references/gear-list-overnight.md","content":"# Gear list (2-person, 1-night ridge/summit camp)\n\n## Must\n- Shelter: tent + stakes + guylines\n- Sleep: sleeping bag (rated for windchill) + sleeping pad\n- Light: headlamp per person + spare power\n- Power: power bank\n- Clothing: wind/rain shell + insulation layer + spare base + hat + gloves\n- Safety: basic first-aid + emergency blanket + whistle\n- Water: assume no refill; carry enough\n- Food: dinner + breakfast + trail snacks + 20% buffer\n\n## Strongly recommended\n- Extra guylines, stronger stakes, tape/zip ties\n- Electrolytes\n- Trekking poles\n\n## Optional\n- Knee support, camp light, sit pad"},{"path":"references/guide-protocol.md","content":"# Low-token guide protocol (Telegram)\n\nRoute ID used in examples: `qiniangshan_jinghua`\n\n## Route acquisition\n- Preferred: user exports/sends GPX/KML via Telegram → deterministic parsing.\n- Optional: user manually logs in to 2bulu in a persistent browser profile; automation may assist after login (no bypass).\n\n## Commands\n- `/use <routeId>` bind route to current chat.\n- `/g` guide once. Location-only message may be treated as `/g`.\n\n## Output (2-4 lines)\nLine 1 (machine):\n`G S:<0|1|2> D:<m> B:<deg><dir> GO:<m> IDX:<n>`\n\n- S: 0=on_route, 1=off_route, 2=arrived\n- D: distance to route (m)\n- B: bearing degrees + dir (N/NE/E/SE/S/SW/W/NW)\n- GO: recommended distance (m) to rejoin/advance\n- IDX: nearest point index (for incremental window search)\n\nLine 2 (Chinese template, deterministic):\n- on_route: `在路线内（偏离{D}米）。朝{dir}（{B}°）前进约{GO}米。`\n- off_route: `你已偏离路线约{D}米。请朝{dir}（{B}°）走约{GO}米回到路线。`\n- arrived: `你已接近终点（{D}米内）。建议在此附近确认营地/下撤方向。`\n\nLine 3 (optional alert, if near a key node):\n`ALERT <letter>: <message>`\n\nLine 4 (optional weather alert, if enabled and sharp change detected):\n`WX ALERT: <CODE> <brief>`\n\n## Defaults\n- toleranceM=50\n- arrivedM=60\n- lookaheadM=120\n- bboxGuardM=2000 (if far from bbox, return E:OUT_OF_BBOX)\n\n## Reference implementation\n- `scripts/guide_route.js`: given a GeoJSON LineString + (lat,lon) (+ optional lastIdx), prints the 2-3 line response.\n  - Add `--alerts references/<route>_alerts.json` to enable key-node alerts.\n  - Add `--state /tmp/guide_state.json --cooldown-sec 1800` to dedupe alerts.\n\n## Errors (single line)\n- `E:NO_ROUTE`\n- `E:OUT_OF_BBOX`\n- `E:GPS_BAD`"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KM... Skill: Trail Nav via Telegram (low-token) Owner: jack4world Summary: Offline-capable hiking route guidance via Telegram location messages (OpenClaw). Use when building/operating an LLM agent workflow that: (1) imports a GPX/KM... Tags: latest:0.3.2 Version history: v0.3.2 | 2026-02-21T17:08:00.122Z | user Fix one-click OpenClaw config patcher to use new skills schema (skills.load.extraDirs + skills.entries), with leg","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1429,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T15:50:23.004Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T15:50:23.004Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T20:57:31.275Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}