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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user