forge-openclaw-plugin 0.2.85 → 0.2.86
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.
|
@@ -2990,6 +2990,53 @@ function applyWorkoutChunkImmediately(session, family, workouts) {
|
|
|
2990
2990
|
}), workouts.length, createdCount, updatedCount, mergedCount, now, now, runId);
|
|
2991
2991
|
});
|
|
2992
2992
|
}
|
|
2993
|
+
function applyWorkoutEvidenceChunkImmediately(session, payload) {
|
|
2994
|
+
const timeSeries = payload.workoutTimeSeries ?? [];
|
|
2995
|
+
const routes = payload.workoutRoutes ?? [];
|
|
2996
|
+
if (timeSeries.length === 0 && routes.length === 0) {
|
|
2997
|
+
return;
|
|
2998
|
+
}
|
|
2999
|
+
const pairing = mobileSyncSessionPairing(session);
|
|
3000
|
+
runInTransaction(() => {
|
|
3001
|
+
const rowsToRecompute = new Map();
|
|
3002
|
+
for (const entry of timeSeries) {
|
|
3003
|
+
const row = getDatabase()
|
|
3004
|
+
.prepare(`SELECT *
|
|
3005
|
+
FROM health_workout_sessions
|
|
3006
|
+
WHERE user_id = ? AND source = 'apple_health' AND external_uid = ?`)
|
|
3007
|
+
.get(pairing.user_id, entry.externalUid);
|
|
3008
|
+
if (!row || entry.samples.length === 0) {
|
|
3009
|
+
continue;
|
|
3010
|
+
}
|
|
3011
|
+
upsertWorkoutTimeSeries({
|
|
3012
|
+
workoutId: row.id,
|
|
3013
|
+
userId: pairing.user_id,
|
|
3014
|
+
samples: entry.samples
|
|
3015
|
+
});
|
|
3016
|
+
rowsToRecompute.set(row.id, row);
|
|
3017
|
+
}
|
|
3018
|
+
for (const entry of routes) {
|
|
3019
|
+
const row = getDatabase()
|
|
3020
|
+
.prepare(`SELECT *
|
|
3021
|
+
FROM health_workout_sessions
|
|
3022
|
+
WHERE user_id = ? AND source = 'apple_health' AND external_uid = ?`)
|
|
3023
|
+
.get(pairing.user_id, entry.externalUid);
|
|
3024
|
+
if (!row || entry.routePoints.length === 0) {
|
|
3025
|
+
continue;
|
|
3026
|
+
}
|
|
3027
|
+
upsertWorkoutRoutePoints({
|
|
3028
|
+
workoutId: row.id,
|
|
3029
|
+
userId: pairing.user_id,
|
|
3030
|
+
points: entry.routePoints
|
|
3031
|
+
});
|
|
3032
|
+
rowsToRecompute.set(row.id, row);
|
|
3033
|
+
}
|
|
3034
|
+
for (const row of rowsToRecompute.values()) {
|
|
3035
|
+
recomputeAndStoreWorkoutAnalytics(row);
|
|
3036
|
+
summarizeUserHealthDay(pairing.user_id, dayKey(row.started_at));
|
|
3037
|
+
}
|
|
3038
|
+
});
|
|
3039
|
+
}
|
|
2993
3040
|
function updateMobileSyncSessionProgress(syncSessionId) {
|
|
2994
3041
|
const chunks = getDatabase()
|
|
2995
3042
|
.prepare(`SELECT family, record_count, byte_count
|
|
@@ -3209,6 +3256,10 @@ export function ingestMobileHealthSyncChunk(syncSessionId, payload, rawPayloadJs
|
|
|
3209
3256
|
parsed.family === "workout_archive") {
|
|
3210
3257
|
applyWorkoutChunkImmediately(session, parsed.family, wirePayload.payload.workouts ?? []);
|
|
3211
3258
|
}
|
|
3259
|
+
else if (parsed.family === "workout_time_series" ||
|
|
3260
|
+
parsed.family === "workout_routes") {
|
|
3261
|
+
applyWorkoutEvidenceChunkImmediately(session, wirePayload.payload);
|
|
3262
|
+
}
|
|
3212
3263
|
const progress = updateMobileSyncSessionProgress(syncSessionId);
|
|
3213
3264
|
return {
|
|
3214
3265
|
accepted: true,
|
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.86",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/package.json
CHANGED