feat(skills): cloud sync client + incremental sync + fork-on-revocation

Adds CloudApiSkillClient (Cloud API per-host sync endpoint + inventory
report), forwards since_version for incremental sync (full-replace on
first/stale), and forks a local override into a standalone local skill
when its cloud skill is revoked (design D9). Skill-side tests green (87
passed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 07:55:08 +08:00
co-authored by Claude Opus 4.6
parent cbfdb2ae39
commit a8ba2312fc
4 changed files with 257 additions and 3 deletions
+12
View File
@@ -143,6 +143,18 @@ class SkillCatalogStore:
(subscription_id, 1 if active else 0),
)
def _get_subscription_version(self, subscription_id: str) -> int | None:
"""Last successfully applied ``latest_version`` for a subscription."""
with self._connect() as conn:
row = conn.execute(
"SELECT last_synced_version FROM subscriptions WHERE id = ?",
(subscription_id,),
).fetchone()
if row is None:
return None
value = row["last_synced_version"]
return int(value) if value is not None else None
def _set_subscription_state(
self,
subscription_id: str,