trip-optimizer 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/cli.js +18 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# trip-optimizer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
If you love travel like I do, you know the pain: before every trip you're deep in Google, TripAdvisor, 小红书, 携程, reading strangers' tips, comparing restaurants, checking transit schedules. You easily spend days, sometimes weeks, on research. Travel is supposed to be leisure and relaxation, not a second job.
|
|
4
|
+
|
|
5
|
+
**trip-optimizer** autonomously optimizes travel plans using Andrej Kaparthy's autoresearch pattern — an AI-powered CLI that researches, scores, and iteratively improves your itinerary.
|
|
4
6
|
|
|
5
7
|
支持 **English** 和 **中文(简体中文)** -- 在初始化时选择语言,整个体验随之适配:提示语、生成的行程、研究搜索、评分系统全部使用您选择的语言。
|
|
6
8
|
|
package/dist/cli.js
CHANGED
|
@@ -1700,13 +1700,13 @@ function readResults(resultsPath) {
|
|
|
1700
1700
|
return lines.slice(1).map((line) => {
|
|
1701
1701
|
const parts = line.split(" ");
|
|
1702
1702
|
return {
|
|
1703
|
-
iteration: parseInt(parts[0], 10),
|
|
1704
|
-
commit: parts[1],
|
|
1705
|
-
score_before: parseFloat(parts[2]),
|
|
1706
|
-
score_after: parseFloat(parts[3]),
|
|
1707
|
-
delta: parseFloat(parts[4]),
|
|
1708
|
-
status: parts[5],
|
|
1709
|
-
mutation_type: parts[6],
|
|
1703
|
+
iteration: parseInt(parts[0], 10) || 0,
|
|
1704
|
+
commit: parts[1] || "",
|
|
1705
|
+
score_before: parseFloat(parts[2]) || 0,
|
|
1706
|
+
score_after: parseFloat(parts[3]) || 0,
|
|
1707
|
+
delta: parseFloat(parts[4]) || 0,
|
|
1708
|
+
status: parts[5] || "discard",
|
|
1709
|
+
mutation_type: parts[6] || "unknown",
|
|
1710
1710
|
description: parts[7] || ""
|
|
1711
1711
|
};
|
|
1712
1712
|
});
|
|
@@ -1938,8 +1938,11 @@ function statusCommand() {
|
|
|
1938
1938
|
console.log(chalk7.bold("\n Last 5 mutations:"));
|
|
1939
1939
|
for (const r of last5) {
|
|
1940
1940
|
const icon = r.status === "keep" ? chalk7.green("\u2713") : chalk7.red("\u2717");
|
|
1941
|
-
const
|
|
1942
|
-
|
|
1941
|
+
const d = isNaN(r.delta) ? 0 : r.delta;
|
|
1942
|
+
const delta = d >= 0 ? `+${d.toFixed(2)}` : d.toFixed(2);
|
|
1943
|
+
const mtype = (r.mutation_type || "unknown").padEnd(10);
|
|
1944
|
+
const desc = (r.description || "").substring(0, 50);
|
|
1945
|
+
console.log(` ${icon} ${mtype} ${desc} ${delta}`);
|
|
1943
1946
|
}
|
|
1944
1947
|
const dbPath = path8.join(cwd, "activities_db.json");
|
|
1945
1948
|
if (fs9.existsSync(dbPath)) {
|
|
@@ -2262,7 +2265,7 @@ function renderDashboard() {
|
|
|
2262
2265
|
return;
|
|
2263
2266
|
}
|
|
2264
2267
|
const lastBest = getLastBestScore(resultsPath);
|
|
2265
|
-
const score = lastBest?.score ?? 0;
|
|
2268
|
+
const score = isNaN(lastBest?.score ?? 0) ? 0 : lastBest?.score ?? 0;
|
|
2266
2269
|
console.log(` Score: ${progressBar(score, 100)} ${chalk10.bold(score.toFixed(2))}/100`);
|
|
2267
2270
|
const scorePath = path10.join(cwd, "score.json");
|
|
2268
2271
|
if (fs12.existsSync(scorePath)) {
|
|
@@ -2297,8 +2300,11 @@ function renderDashboard() {
|
|
|
2297
2300
|
console.log(chalk10.bold("\n Recent Mutations:"));
|
|
2298
2301
|
for (const r of last5) {
|
|
2299
2302
|
const icon = r.status === "keep" ? chalk10.green("\u2713") : chalk10.red("\u2717");
|
|
2300
|
-
const
|
|
2301
|
-
|
|
2303
|
+
const d = isNaN(r.delta) ? 0 : r.delta;
|
|
2304
|
+
const delta = d >= 0 ? chalk10.green(`+${d.toFixed(2)}`) : chalk10.red(d.toFixed(2));
|
|
2305
|
+
const mtype = (r.mutation_type || "unknown").padEnd(10);
|
|
2306
|
+
const desc = (r.description || "").substring(0, 45).padEnd(45);
|
|
2307
|
+
console.log(` ${icon} #${String(r.iteration || 0).padStart(3)} ${mtype} ${desc} ${delta}`);
|
|
2302
2308
|
}
|
|
2303
2309
|
const totalIterations = results[results.length - 1].iteration;
|
|
2304
2310
|
const keeps = results.filter((r) => r.status === "keep").length;
|