1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! OPFS-local working copy of the agent's self-defined skills.
//!
//! `.lh_skills.json` mirrors the on-chain blob stored under
//! `keccak256("localharness.skills")` (written by the `create_skill` /
//! `delete_skill` tools; merge semantics in `crate::skills`). Session bootstrap
//! reads the local copy without an RPC round-trip; a device that has never
//! defined a skill here falls back to the on-chain slot for this tenant's
//! tokenId — so skills survive sessions AND devices.
const SKILLS_FILE: &str = ".lh_skills.json";
/// Read the local skills working copy (a JSON array). `None` when absent/empty.
pub async
/// Persist `content` (a JSON array) as the local skills working copy (atomic swap).
pub async
/// The skills blob for THIS tenant: the OPFS working copy when present, else
/// the published on-chain `skills_of` slot (second device / fresh profile).
/// `None` when no skills exist anywhere (or not on a registered tenant) —
/// best-effort, an RPC failure degrades to no skills.
pub async