fix: VariableStore.get() default parameter and Docker improvements

- Add default parameter to VariableStore.get() method
- Install nano in Docker for TUI editor support
- Install dearpygui in Docker for GUI support
- Add GUI library dependencies (libgl1, libegl1, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rob 2025-12-29 11:57:05 -04:00
parent a39103c2ca
commit c592b93597
2 changed files with 23 additions and 4 deletions

View File

@ -38,6 +38,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
plantuml \
jq \
nano \
# GUI dependencies for dearpygui
libgl1 \
libegl1 \
libxkbcommon0 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-keysyms1 \
libxcb-shape0 \
libxcb-xinerama0 \
libxcb-randr0 \
libxcb-render-util0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
@ -59,6 +71,9 @@ COPY tests/ ./tests/
# Install Orchestrated Discussions
RUN pip install --no-cache-dir -e ".[dev]"
# Install dearpygui for GUI (optional, may fail on some systems)
RUN pip install --no-cache-dir dearpygui || echo "dearpygui install failed, GUI will use TUI fallback"
# Create directories
RUN mkdir -p /root/.smarttools /root/.local/bin

View File

@ -246,12 +246,16 @@ class VariableStore:
else:
self._store[name] = value
def get(self, ref: str):
def get(self, ref: str, default=None):
"""
Get a variable value. Ref can be:
- $varname - simple lookup
- $varname.field - JSON field access
- $varname.field.subfield - nested access
Args:
ref: Variable reference (e.g., "$varname" or "$varname.field")
default: Default value if variable not found
"""
if not ref.startswith("$"):
return ref # Literal value
@ -261,7 +265,7 @@ class VariableStore:
value = self._store.get(parts[0])
if value is None:
return None
return default
# Navigate nested fields
for part in parts[1:]:
@ -271,9 +275,9 @@ class VariableStore:
idx = int(part)
value = value[idx] if idx < len(value) else None
else:
return None
return default
if value is None:
return None
return default
return value