feat(artifacts): last updated time on skills and files; each installer's copy marked

A row said nothing about when its content last changed, and the install list
could not tell who still runs an old version. `artifacts.version_at` (new
column, existing rows from `updated_at`) is stamped only when a snapshot is
replaced — a rename or share toggle leaves it — and served as `versionAt`:
skill and file rows read "Updated 3h ago", the detail sheet "Last updated".
`GET /api/artifacts/:id/installs` gives each skill install a `state` —
latest / outdated / removed / unknown — from its Claude skill copies' hash
against the newest snapshot, shown as a badge.
This commit is contained in:
2026-10-30 15:21:31 +07:00
parent bc44cbc8b7
commit d09c9d6633
9 changed files with 161 additions and 12 deletions
+5
View File
@@ -973,11 +973,16 @@ for (const [col, ddl] of [
["suggested_owner_id", "suggested_owner_id INTEGER"],
["version", "version TEXT"],
["source_hash", "source_hash TEXT"],
["version_at", "version_at TEXT"],
]) {
try {
db.prepare(`SELECT ${col} FROM artifacts LIMIT 1`).get();
} catch {
db.prepare(`ALTER TABLE artifacts ADD COLUMN ${ddl}`).run();
// `version_at`: when a row's CONTENT last changed (a new snapshot) — a
// rename or a share toggle moves `updated_at` but not this. An existing
// row starts from its `updated_at`, the best record there is.
if (col === "version_at") db.prepare("UPDATE artifacts SET version_at = updated_at").run();
}
}