feat: LibreOffice Calc extension, ODS library, AI description, audit design
Calc extension (pkg/calc/):
- Python UNO ProtocolHandler with 8 toolbar commands
- SiloClient HTTP client adapted from FreeCAD workbench
- Pull BOM/Project: populates sheets with 28-col format, hidden property
columns, row hash tracking, auto project tagging
- Push: row classification, create/update items, conflict detection
- Completion wizard: 3-step category/description/fields with PN conflict
resolution dialog
- OpenRouter AI integration: generate standardized descriptions from seller
text, configurable model/instructions, review dialog
- Settings: JSON persistence, env var fallbacks, OpenRouter fields
- 31 unit tests (no UNO/network required)
Go ODS library (internal/ods/):
- Pure Go ODS read/write (ZIP of XML, no headless LibreOffice)
- Writer, reader, 10 round-trip tests
Server ODS endpoints (internal/api/ods.go):
- GET /api/items/export.ods, template.ods, POST import.ods
- GET /api/items/{pn}/bom/export.ods
- GET /api/projects/{code}/sheet.ods
- POST /api/sheets/diff
Documentation:
- docs/CALC_EXTENSION.md: extension progress report
- docs/COMPONENT_AUDIT.md: web audit tool design with weighted scoring,
assembly computed fields, batch AI assistance plan
This commit is contained in:
58
Makefile
58
Makefile
@@ -1,6 +1,7 @@
|
||||
.PHONY: build run test clean migrate fmt lint \
|
||||
docker-build docker-up docker-down docker-logs docker-ps \
|
||||
docker-clean docker-rebuild
|
||||
docker-clean docker-rebuild \
|
||||
build-calc-oxt install-calc uninstall-calc install-calc-dev test-calc
|
||||
|
||||
# =============================================================================
|
||||
# Local Development
|
||||
@@ -19,13 +20,14 @@ run:
|
||||
cli:
|
||||
go run ./cmd/silo $(ARGS)
|
||||
|
||||
# Run tests
|
||||
# Run tests (Go + Python)
|
||||
test:
|
||||
go test -v ./...
|
||||
python3 -m unittest pkg/calc/tests/test_basics.py -v
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
rm -f silo silod
|
||||
rm -f silo silod silo-calc.oxt
|
||||
rm -f *.out
|
||||
|
||||
# Format code
|
||||
@@ -158,6 +160,48 @@ uninstall-freecad:
|
||||
rm -f $(FREECAD_MOD_DIR_LEGACY)/Silo
|
||||
@echo "Uninstalled Silo workbench"
|
||||
|
||||
# =============================================================================
|
||||
# LibreOffice Calc Extension
|
||||
# =============================================================================
|
||||
|
||||
# Build .oxt extension package
|
||||
build-calc-oxt:
|
||||
@echo "Building silo-calc.oxt..."
|
||||
@cd pkg/calc && zip -r ../../silo-calc.oxt . \
|
||||
-x '*.pyc' '*__pycache__/*' 'tests/*' '.gitignore'
|
||||
@echo "Built silo-calc.oxt"
|
||||
|
||||
# Install extension system-wide (requires unopkg)
|
||||
install-calc: build-calc-oxt
|
||||
unopkg add --shared silo-calc.oxt 2>/dev/null || unopkg add silo-calc.oxt
|
||||
@echo "Installed silo-calc extension. Restart LibreOffice to load."
|
||||
|
||||
# Uninstall extension
|
||||
uninstall-calc:
|
||||
unopkg remove io.kindredsystems.silo.calc 2>/dev/null || true
|
||||
@echo "Uninstalled silo-calc extension."
|
||||
|
||||
# Development install: symlink into user extensions dir
|
||||
install-calc-dev:
|
||||
@CALC_EXT_DIR="$${HOME}/.config/libreoffice/4/user/extensions"; \
|
||||
if [ -d "$$CALC_EXT_DIR" ]; then \
|
||||
rm -rf "$$CALC_EXT_DIR/silo-calc"; \
|
||||
ln -sf $(PWD)/pkg/calc "$$CALC_EXT_DIR/silo-calc"; \
|
||||
echo "Symlinked to $$CALC_EXT_DIR/silo-calc"; \
|
||||
else \
|
||||
echo "LibreOffice extensions dir not found at $$CALC_EXT_DIR"; \
|
||||
echo "Try: install-calc (uses unopkg)"; \
|
||||
fi
|
||||
@echo "Restart LibreOffice to load the Silo Calc extension"
|
||||
|
||||
# Run Python tests for the Calc extension
|
||||
test-calc:
|
||||
python3 -m unittest pkg/calc/tests/test_basics.py -v
|
||||
|
||||
# Clean extension package
|
||||
clean-calc:
|
||||
rm -f silo-calc.oxt
|
||||
|
||||
# =============================================================================
|
||||
# API Testing
|
||||
# =============================================================================
|
||||
@@ -219,6 +263,14 @@ help:
|
||||
@echo " install-freecad-native - Install for native FreeCAD"
|
||||
@echo " uninstall-freecad - Remove workbench symlinks"
|
||||
@echo ""
|
||||
@echo "LibreOffice Calc:"
|
||||
@echo " build-calc-oxt - Build .oxt extension package"
|
||||
@echo " install-calc - Install extension (uses unopkg)"
|
||||
@echo " install-calc-dev - Symlink for development"
|
||||
@echo " uninstall-calc - Remove extension"
|
||||
@echo " test-calc - Run Python tests for extension"
|
||||
@echo " clean-calc - Remove .oxt file"
|
||||
@echo ""
|
||||
@echo "API Testing:"
|
||||
@echo " api-health - Test health endpoint"
|
||||
@echo " api-schemas - List schemas"
|
||||
|
||||
Reference in New Issue
Block a user