Files
Suzu008 a58a5b8917 refactor(sw): bidirectional SW status sync with IndexedDB persistence
Replace fire-and-forget key delivery with a sync-status protocol that
verifies key consistency between main thread and Service Worker using
SHA-256 fingerprints via MessageChannel request-response.

- SW (ts/sw.ts): persist keys in IndexedDB, auto-restore on activate;
  respond to sync-status queries with loaded keys + fingerprints;
  support cryptio-clear-keys to wipe memory + DB.
- New ts/utils/swSync.ts: single entry point for SW registration,
  key sync, and status verification. Controller change listener
  re-syncs on SW restart. Deduplicates concurrent sync calls.
- Deleted ts/utils/swKeySender.ts (replaced by swSync.ts).
- Remove SW registration (~55 lines) from cryptioSaveImage.ts;
  setup() now calls syncSWStatus().
- uploadUtils.ts: drop 5-retry preview loop (~6.4s worst case);
  single attempt with syncSWStatus fallback on failure.
- cryptioSettings.ts: sync after key changes; clearSWKeys() on
  Clear All.
- cryptioUploadImage/Video.ts: syncSWStatus in setup + preview
  fallback.
- types.ts: add SWStatus interface.
2026-05-30 22:29:45 +08:00

23 lines
566 B
Python

"""Top-level package for cryptio."""
from comfy_api.latest import ComfyExtension, io
from .src.cryptio.nodes import NODE_CLASS_MAPPINGS as _NODE_CLASS_MAPPINGS
WEB_DIRECTORY = "./js"
__all__ = ["WEB_DIRECTORY", "comfy_entrypoint"]
__author__ = """ComfyUI-CryptoIO"""
__email__ = "thesoup@foxmail.com"
__version__ = "0.0.1"
class CryptIOExtension(ComfyExtension):
async def get_node_list(self) -> list[type[io.ComfyNode]]:
return list(_NODE_CLASS_MAPPINGS.values())
async def comfy_entrypoint() -> CryptIOExtension:
return CryptIOExtension()