@leviyuan/lodestar 0.21.25 → 0.21.27
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/dist/dsh-bridge.js +28 -7
- package/dist/lodestar-agent.js +4 -4
- package/dist/lodestar-claude.js +6 -6
- package/dist/lodestar-setup.js +4 -4
- package/dist/lodestar-stop.js +1 -1
- package/dist/lodestar-update.js +13 -13
- package/dist/lodestar-version.js +6 -6
- package/dist/lodestar.js +240 -238
- package/docs/configuration.md +2 -2
- package/docs/models.md +2 -2
- package/docs/usage.md +5 -3
- package/package.json +2 -2
package/dist/dsh-bridge.js
CHANGED
|
@@ -300,18 +300,39 @@ function apply(ctx) {
|
|
|
300
300
|
continue;
|
|
301
301
|
const stored = await ctx.sessionPersistence.open(header.id, "read");
|
|
302
302
|
let preview = header.id;
|
|
303
|
+
let lastPreview;
|
|
303
304
|
try {
|
|
304
|
-
const { events } = await stored.read(
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
305
|
+
const { events } = await stored.read();
|
|
306
|
+
const userText = (event) => {
|
|
307
|
+
if (event?.type !== "user/message" || event.data.source.kind !== "user")
|
|
308
|
+
return "";
|
|
309
|
+
return event.data.content.filter((part) => part.type === "text").map((part) => part.text).join(" ").replace(/\s+/g, " ").trim();
|
|
310
|
+
};
|
|
311
|
+
for (const event of events) {
|
|
312
|
+
const text = userText(event);
|
|
313
|
+
if (text) {
|
|
314
|
+
preview = text.slice(0, 120);
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
for (let i = events.length - 1;i >= 0; i--) {
|
|
319
|
+
const text = userText(events[i]);
|
|
320
|
+
if (text) {
|
|
321
|
+
lastPreview = text.slice(0, 120);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
310
324
|
}
|
|
311
325
|
} finally {
|
|
312
326
|
await stored.close();
|
|
313
327
|
}
|
|
314
|
-
rows.push({
|
|
328
|
+
rows.push({
|
|
329
|
+
provider: "dsh",
|
|
330
|
+
sessionId: header.id,
|
|
331
|
+
cwd: header.cwd,
|
|
332
|
+
ts: header.createdAt,
|
|
333
|
+
preview,
|
|
334
|
+
...lastPreview && lastPreview !== preview ? { lastPreview } : {}
|
|
335
|
+
});
|
|
315
336
|
}
|
|
316
337
|
return rows.sort((a, b) => b.ts - a.ts);
|
|
317
338
|
}
|