Move runtime artifacts out of the source tree to ~/trips
The dev directory now holds source code + compiled binaries only:
~/trips/osm/ OSM PBF extracts (was osm/, 1.4 GB)
~/trips/tilecache/ mock tile cache (was mock/.tilecache)
~/trips/store/mock/ per-trip uploads + chat logs (was mock/store, PII)
~/trips/logs/ server.log
~/trips/stale-osm-build/ stale source/tarball dup of ~/osm-build
(repo osm/build had no binaries; the live OSRM
toolchain + graphs already lived in ~/osm-build)
Code now points at the new locations, all overridable via env:
- mock/server.js: TRIPS_HOME (default ~/trips) for tile cache + store
- setup-osrm.sh / setup-osrm-colombia.sh: OSM_DIR (default ~/trips/osm)
- spatial/compose+import.sh: OSM_DIR (default ~/trips/osm)
- .gitignore: rewritten — no artifact paths remain in-tree
This commit is contained in:
+3
-3
@@ -1925,9 +1925,9 @@ let version = 0;
|
||||
let history = []; // [{v, label, at, days, stays}]
|
||||
let hIdx = -1; // pointer into history
|
||||
let tripDocs = {}; // name → {name,kind,chars,text,truncated,at} — attached documents
|
||||
// (authoritative copy lives on the server: mock/store/<trip>/docs/)
|
||||
// (authoritative copy lives on the server: ~/trips/store/mock/<trip>/docs/)
|
||||
let chatLog = []; // [{role:'user'|'assistant', text}] — conversation turns, persisted
|
||||
// per trip on the server (mock/store/<trip>/chat.jsonl) so a
|
||||
// per trip on the server (~/trips/store/mock/<trip>/chat.jsonl) so a
|
||||
// follow-up ("yes, do it") can see what the model said earlier,
|
||||
// even after a reload
|
||||
let storeReady = Promise.resolve(); // resolve when this trip's server store has loaded
|
||||
@@ -2407,7 +2407,7 @@ let persistT = 0;
|
||||
function persistTrip(force = false) {
|
||||
clearTimeout(persistT);
|
||||
const hist = history.slice(0, hIdx + 1).slice(-25); // drop the redo tail, cap at 25
|
||||
// docs + chat live on the server now (mock/store/<trip>/) — localStorage
|
||||
// docs + chat live on the server now (~/trips/store/mock/<trip>/) — localStorage
|
||||
// only carries the plan state. force: skip the debounce — the re-anchoring
|
||||
// of the whole trip around booked flights is the one edit we must never lose
|
||||
const save = () => tripStore.save(tripId, { days, stays, version, hIdx: hist.length - 1, history: hist, bookings: M.trip.bookings, title: M.trip.title });
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Pre-cache OSM tiles for the trip's map extent through the local proxy
|
||||
# (which stores them in mock/.tilecache). Usage:
|
||||
# (the proxy stores them in ~/trips/tilecache). Usage:
|
||||
# pre-cache-tiles.sh # all trips
|
||||
# pre-cache-tiles.sh colombia z16 # one trip, one zoom
|
||||
set -euo pipefail
|
||||
@@ -60,4 +60,5 @@ for trip in "${TRIPS[@]}"; do
|
||||
fetch "$trip" "$z" | xargs -P 8 -n 1 curl -s -o /dev/null -m 20 --retry 2 > /dev/null
|
||||
done
|
||||
done
|
||||
echo "done. cache size: $(du -sh .tilecache | cut -f1)"
|
||||
CACHE_DIR="${TRIPS_HOME:-$HOME/trips}/tilecache"
|
||||
echo "done. cache size: $(du -sh "$CACHE_DIR" 2>/dev/null | cut -f1)"
|
||||
|
||||
+6
-2
@@ -44,9 +44,13 @@ const SEARXNG = { base: process.env.SEARXNG_BASE || 'http://192.168.3.4:30053' }
|
||||
const SPATIAL = { url: process.env.SPATIAL_URL || 'http://localhost:5005' };
|
||||
const routerFor = (u) => ROUTERS[u.searchParams.get('router') || 'northeast'] || ROUTERS.northeast;
|
||||
const PROFILE = { foot: 'walking', walk: 'walking', bike: 'cycling', cycle: 'cycling', car: 'driving', drive: 'driving', transit: 'driving' };
|
||||
const CACHE = path.join(__dirname, '.tilecache');
|
||||
// Runtime artifacts live OUTSIDE the source tree — the repo holds code +
|
||||
// built binaries only. Home: ~/trips (override with TRIPS_HOME).
|
||||
const TRIPS_HOME = process.env.TRIPS_HOME || path.join(os.homedir(), 'trips');
|
||||
const CACHE = path.join(TRIPS_HOME, 'tilecache');
|
||||
fs.mkdirSync(CACHE, { recursive: true });
|
||||
const STORE = path.join(__dirname, 'store'); // per-trip uploads (originals + parsed) + chat logs
|
||||
// per-trip uploads (originals + parsed) + chat logs: ~/trips/store/mock/<trip>/
|
||||
const STORE = path.join(TRIPS_HOME, 'store', 'mock');
|
||||
fs.mkdirSync(STORE, { recursive: true });
|
||||
|
||||
const mime = {
|
||||
|
||||
Reference in New Issue
Block a user