diff --git a/build-python/meson.build b/build-python/meson.build index c9cc470..3ebe8ee 100644 --- a/build-python/meson.build +++ b/build-python/meson.build @@ -105,7 +105,8 @@ py_installation.install_sources( meson.project_source_root() + '/fourdst/core/bundle.py', meson.project_source_root() + '/fourdst/core/config.py', meson.project_source_root() + '/fourdst/core/platform.py', - meson.project_source_root() + '/fourdst/core/utils.py' + meson.project_source_root() + '/fourdst/core/utils.py', + meson.project_source_root() + '/fourdst/core/keys.py', ), subdir: 'fourdst/core' ) diff --git a/electron/bridge.py b/electron/bridge.py index e93934c..1652629 100644 --- a/electron/bridge.py +++ b/electron/bridge.py @@ -11,11 +11,10 @@ that now return JSON directly. No more complex stdout mixing or data wrapping. Key Changes: - Core functions return JSON-serializable dictionaries directly - Progress messages go to stderr only (never mixed with JSON output) -- Clean JSON output to stdout for Electron to parse -- Simplified error handling with consistent JSON error format """ import sys +import os import json import inspect import traceback @@ -35,7 +34,7 @@ class FourdstEncoder(json.JSONEncoder): project_root = Path(__file__).resolve().parent.parent sys.path.insert(0, str(project_root)) -from fourdst.core import bundle +from fourdst.core import bundle, keys def main(): # Use stderr for all logging to avoid interfering with JSON output on stdout @@ -62,13 +61,25 @@ def main(): print(f"[BRIDGE_INFO] Parsed kwargs: {kwargs}", file=log_file, flush=True) # Convert path strings to Path objects where needed + path_params = ['outputDir', 'output_dir', 'keyPath', 'key_path', 'bundlePath', 'bundle_path', 'path'] for key, value in kwargs.items(): - if isinstance(value, str) and ('path' in key.lower() or 'key' in key.lower()): + if isinstance(value, str) and key in path_params: kwargs[key] = Path(value) elif isinstance(value, list) and 'dirs' in key.lower(): kwargs[key] = [Path(p) for p in value] - func = getattr(bundle, command) + # Route commands to appropriate modules + key_commands = [ + 'list_keys', 'generate_key', 'add_key', 'remove_key', + 'sync_remotes', 'get_remote_sources', 'add_remote_source', 'remove_remote_source' + ] + + if command in key_commands: + func = getattr(keys, command) + module_name = "keys" + else: + func = getattr(bundle, command) + module_name = "bundle" # Create progress callback that sends structured progress to stderr # This keeps progress separate from the final JSON result on stdout @@ -87,7 +98,9 @@ def main(): if 'progress_callback' in sig.parameters: kwargs['progress_callback'] = progress_callback - print(f"[BRIDGE_INFO] Calling function `bundle.{command}`...", file=log_file, flush=True) + print(f"[BRIDGE_INFO] Calling function `{module_name}.{command}`...", file=log_file, flush=True) + print(f"[BRIDGE_DEBUG] Function signature: {func.__name__}{inspect.signature(func)}", file=log_file, flush=True) + print(f"[BRIDGE_DEBUG] Kwargs being passed: {kwargs}", file=log_file, flush=True) result = func(**kwargs) print(f"[BRIDGE_INFO] Function returned successfully.", file=log_file, flush=True) diff --git a/electron/index.html b/electron/index.html index 3db0b7b..2517be9 100644 --- a/electron/index.html +++ b/electron/index.html @@ -30,6 +30,10 @@
LC
libconstants +
+
KM
+ Key Management +
OC
OPAT Core @@ -71,6 +75,19 @@
+ + + +
+
KM
+
+

Key Management

+

Manage cryptographic keys for bundle signing and verification.

+
+
+
LC
@@ -455,6 +480,118 @@
+ + + diff --git a/electron/installer-resources/welcome.html b/electron/installer-resources/welcome.html index 665f0fe..931f9ea 100644 --- a/electron/installer-resources/welcome.html +++ b/electron/installer-resources/welcome.html @@ -60,7 +60,7 @@

This installer will install the 4DSTAR Bundle Manager, a comprehensive tool for managing 4DSTAR plugin bundles and OPAT data files.

-
+
What's Included: