observal-pi 1.3.0 → 1.4.0
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 +7 -7
- package/extensions/observal.ts +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ pi install npm:observal-pi
|
|
|
15
15
|
|
|
16
16
|
## Prerequisites
|
|
17
17
|
|
|
18
|
-
1. An Observal account
|
|
18
|
+
1. An Observal account (run `observal auth login` to authenticate)
|
|
19
19
|
2. Pi installed (`>=0.74.0`)
|
|
20
20
|
|
|
21
21
|
## What it does
|
|
@@ -35,11 +35,11 @@ pi install npm:observal-pi
|
|
|
35
35
|
|
|
36
36
|
## Design
|
|
37
37
|
|
|
38
|
-
- **Zero dependencies
|
|
39
|
-
- **Fail-open
|
|
40
|
-
- **5s timeout
|
|
41
|
-
- **Chunked uploads
|
|
42
|
-
- **Dedup-safe
|
|
38
|
+
- **Zero dependencies**: only `node:*` built-ins
|
|
39
|
+
- **Fail-open**: never throws, never crashes pi. If the server is unreachable, pi continues normally
|
|
40
|
+
- **5s timeout**: all HTTP calls abort after 5 seconds
|
|
41
|
+
- **Chunked uploads**: batches of 500 lines max per request
|
|
42
|
+
- **Dedup-safe**: server deduplicates by `(session_id, line_offset, line_hash)`
|
|
43
43
|
|
|
44
44
|
## Configuration
|
|
45
45
|
|
|
@@ -56,4 +56,4 @@ Sync state is tracked in `~/.observal/sync_state.json` (per-session byte offsets
|
|
|
56
56
|
|
|
57
57
|
## License
|
|
58
58
|
|
|
59
|
-
AGPL-3.0-only
|
|
59
|
+
AGPL-3.0-only. See [LICENSE](./LICENSE)
|
package/extensions/observal.ts
CHANGED
|
@@ -201,8 +201,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
201
201
|
let consumedBytes = 0;
|
|
202
202
|
for (let i = 0; i < rawLines.length; i++) {
|
|
203
203
|
const line = rawLines[i]!;
|
|
204
|
-
if (i === rawLines.length - 1
|
|
205
|
-
|
|
204
|
+
if (i === rawLines.length - 1) {
|
|
205
|
+
// Last element after split: either empty (file ended with \n)
|
|
206
|
+
// or an incomplete line (file didn't end with \n). Either way, stop.
|
|
207
|
+
break;
|
|
206
208
|
}
|
|
207
209
|
if (line.trim()) {
|
|
208
210
|
lines.push(line);
|