Port the AGS widgets into the shell as plugins

This commit is contained in:
2026-09-20 00:09:41 -04:00
parent c5434026a8
commit 0c422e7345
31 changed files with 1740 additions and 17 deletions
@@ -0,0 +1,27 @@
.pragma library
// Each history file is one line of JSON, so the reader concatenates the
// directory and parses line by line. Newest first, by timestamp.
function parseHistory(raw) {
var lines = String(raw || "").split("\n")
var entries = []
for (var i = 0; i < lines.length; i++) {
var line = lines[i].trim()
if (!line) continue
try {
var value = JSON.parse(line)
if (!value || typeof value !== "object") continue
entries.push({
id: value.id || 0,
app: value.app || "",
summary: value.summary || "",
body: value.body || "",
timestamp: Number(value.timestamp) || 0
})
} catch (e) {
continue
}
}
entries.sort(function(a, b) { return b.timestamp - a.timestamp })
return entries
}