agent-hub-runtime 0.6.0

AgentHub desktop and companion CLI runtime for Tauri applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(() => {
  const read = (storage) => {
    const result = {};
    let bytes = 0;
    if (storage.length > 2000)
      throw Error("Storage exceeds the inspection limit");
    for (let index = 0; index < storage.length; index++) {
      const key = storage.key(index),
        value = storage.getItem(key);
      bytes += (key?.length || 0) + (value?.length || 0);
      if (bytes > 512 * 1024)
        throw Error("Storage exceeds the inspection limit");
      Object.defineProperty(result, key, { value, enumerable: true });
    }
    return result;
  };
  return { local: read(localStorage), session: read(sessionStorage) };
})();