forge-openclaw-plugin 0.2.81 → 0.2.83
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
import { inflateSync } from "node:zlib";
|
|
2
|
+
import { inflateRawSync, inflateSync } from "node:zlib";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { getDatabase, runInTransaction } from "./db.js";
|
|
5
5
|
import { HttpError } from "./errors.js";
|
|
@@ -276,6 +276,7 @@ const mobileHealthSyncFamilySchema = z.enum([
|
|
|
276
276
|
"sleep_segments",
|
|
277
277
|
"sleep_raw_records",
|
|
278
278
|
"workout_summaries",
|
|
279
|
+
"workout_archive",
|
|
279
280
|
"workout_time_series",
|
|
280
281
|
"workout_routes",
|
|
281
282
|
"workout_tombstones",
|
|
@@ -2754,9 +2755,7 @@ function parseDeflateBase64ChunkPayload(payloadJsonDeflateBase64, context) {
|
|
|
2754
2755
|
}
|
|
2755
2756
|
let decoded;
|
|
2756
2757
|
try {
|
|
2757
|
-
decoded =
|
|
2758
|
-
maxOutputLength: HEALTH_MOBILE_SYNC_CHUNK_MAX_BYTES + 1
|
|
2759
|
-
});
|
|
2758
|
+
decoded = inflateHealthSyncChunkPayload(compressed);
|
|
2760
2759
|
}
|
|
2761
2760
|
catch (error) {
|
|
2762
2761
|
const errorCode = typeof error === "object" && error !== null && "code" in error
|
|
@@ -2805,6 +2804,21 @@ function parseDeflateBase64ChunkPayload(payloadJsonDeflateBase64, context) {
|
|
|
2805
2804
|
mode: HEALTH_MOBILE_SYNC_COMPRESSED_CHUNK_PAYLOAD_ENCODING
|
|
2806
2805
|
};
|
|
2807
2806
|
}
|
|
2807
|
+
function inflateHealthSyncChunkPayload(compressed) {
|
|
2808
|
+
const options = { maxOutputLength: HEALTH_MOBILE_SYNC_CHUNK_MAX_BYTES + 1 };
|
|
2809
|
+
try {
|
|
2810
|
+
return inflateSync(compressed, options);
|
|
2811
|
+
}
|
|
2812
|
+
catch (error) {
|
|
2813
|
+
const errorCode = typeof error === "object" && error !== null && "code" in error
|
|
2814
|
+
? error.code
|
|
2815
|
+
: undefined;
|
|
2816
|
+
if (errorCode === "ERR_BUFFER_TOO_LARGE") {
|
|
2817
|
+
throw error;
|
|
2818
|
+
}
|
|
2819
|
+
return inflateRawSync(compressed, options);
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2808
2822
|
function resolveChunkWirePayload(parsed, syncSessionId, rawPayloadJson) {
|
|
2809
2823
|
if (parsed.payloadJsonDeflateBase64) {
|
|
2810
2824
|
return parseDeflateBase64ChunkPayload(parsed.payloadJsonDeflateBase64, {
|
|
@@ -2839,6 +2853,12 @@ function summarizeChunkPayload(family, payload) {
|
|
|
2839
2853
|
return { sleepRawRecords: payload.sleepRawRecords?.length ?? 0 };
|
|
2840
2854
|
case "workout_summaries":
|
|
2841
2855
|
return { workouts: payload.workouts?.length ?? 0 };
|
|
2856
|
+
case "workout_archive":
|
|
2857
|
+
return {
|
|
2858
|
+
workouts: payload.workouts?.length ?? 0,
|
|
2859
|
+
samples: payload.workouts?.reduce((sum, workout) => sum + workout.timeSeriesSamples.length, 0) ?? 0,
|
|
2860
|
+
routePoints: payload.workouts?.reduce((sum, workout) => sum + workout.routePoints.length, 0) ?? 0
|
|
2861
|
+
};
|
|
2842
2862
|
case "workout_time_series":
|
|
2843
2863
|
return {
|
|
2844
2864
|
workouts: payload.workoutTimeSeries?.length ?? 0,
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "forge-openclaw-plugin",
|
|
3
3
|
"name": "Forge",
|
|
4
4
|
"description": "Curated OpenClaw adapter for the Forge collaboration API, UI entrypoint, and localhost auto-start runtime.",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.83",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/package.json
CHANGED