dsh-mini-remote 0.1.5 → 0.1.7
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/CHANGELOG.md +35 -0
- package/README.md +8 -1
- package/lib/art/work-1-ready.webp +0 -0
- package/lib/art/work-2-reading.webp +0 -0
- package/lib/art/work-3-typing.webp +0 -0
- package/lib/art/work-4-checking.webp +0 -0
- package/lib/art/work-5-thinking.webp +0 -0
- package/lib/art/work-6-running.webp +0 -0
- package/lib/art/work-7-waiting.webp +0 -0
- package/lib/art/work-8-sprinting.webp +0 -0
- package/lib/art/work-9-talking.webp +0 -0
- package/lib/build.js +4 -1
- package/lib/index.js +327 -39
- package/lib/log-tail.js +5 -1
- package/lib/page.html +424 -20
- package/lib/page.js +43 -2
- package/lib/server.js +159 -8
- package/lib/title-cache.js +122 -0
- package/lib/tree.js +222 -49
- package/package.json +3 -3
package/lib/log-tail.js
CHANGED
|
@@ -206,7 +206,7 @@ function alignToTurnStart(events) {
|
|
|
206
206
|
* windowBytes:起始窗口(压缩字节,默认 4 MB)
|
|
207
207
|
* maxWindowBytes:窗口放大上限(默认 64 MB;最后一帧比窗口大时会放大重来)
|
|
208
208
|
* maxEvents:最多返回多少条事件(默认 2000;0 = 不限)
|
|
209
|
-
* @returns {{events:Array, truncated:boolean}|null} 拿不到日志 / 解不出任何事件 → null
|
|
209
|
+
* @returns {{events:Array, whole:boolean, truncated:boolean}|null} 拿不到日志 / 解不出任何事件 → null
|
|
210
210
|
*/
|
|
211
211
|
export function readTailEvents(sessionId, options = {}) {
|
|
212
212
|
const maxWindowBytes = options.maxWindowBytes ?? 64 * 1024 * 1024
|
|
@@ -224,6 +224,10 @@ export function readTailEvents(sessionId, options = {}) {
|
|
|
224
224
|
const from = alignToTurnStart(kept)
|
|
225
225
|
return {
|
|
226
226
|
events: kept.slice(from),
|
|
227
|
+
// 窗口有没有把整份日志盖住。「不是全部」有两种来路——窗口只够日志尾部,
|
|
228
|
+
// 或者条数到了上限——调用方得靠这个字段把两者分开说:只有前一种才是
|
|
229
|
+
// 「这个会话很大」,后一种跟大小无关。
|
|
230
|
+
whole: read.whole,
|
|
227
231
|
// 「不是全部」有三种来路:本来就没从头读、条数被上限砍了、以及为了对齐起点丢了几条。
|
|
228
232
|
truncated: !read.whole || droppedByCount || from > 0,
|
|
229
233
|
}
|