Files
silo/internal/ods/ods.go
Forbes afb382b68d 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
2026-02-01 10:06:20 -06:00

49 lines
1.1 KiB
Go

// Package ods provides a lightweight ODS (OpenDocument Spreadsheet) writer and reader.
// ODS files are ZIP archives containing XML files conforming to the
// OpenDocument Format (ODF) 1.2 specification (ISO/IEC 26300).
package ods
// CellType represents the data type of a cell.
type CellType int
const (
CellString CellType = iota
CellFloat
CellCurrency
CellDate
CellFormula
CellEmpty
)
// Sheet represents a named sheet within an ODS workbook.
type Sheet struct {
Name string
Columns []Column
Rows []Row
}
// Column defines column properties.
type Column struct {
Width string // e.g., "2.5cm", "80pt"
Hidden bool
}
// Row represents a single row.
type Row struct {
Cells []Cell
IsBlank bool // preserve blank separator rows
}
// Cell represents a single cell value.
type Cell struct {
Value string // display/string value
Type CellType // data type
Formula string // ODS formula, e.g., "of:=[.G3]*[.H3]"
}
// Workbook is the top-level container passed to Write.
type Workbook struct {
Sheets []Sheet
Meta map[string]string // custom metadata key-value pairs
}