@nomad-e/bluma-cli 0.26.1 → 2026.27.0-darwin-arm64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +189 -70
- package/README.md +2 -162
- package/THIRD-PARTY-NOTICES.txt +46201 -0
- package/bin/bluma-core +0 -0
- package/package.json +24 -124
- package/third-party/option-ext/.cargo_vcs_info.json +6 -0
- package/third-party/option-ext/Cargo.toml +22 -0
- package/third-party/option-ext/LICENSE.txt +373 -0
- package/third-party/option-ext/README.md +67 -0
- package/third-party/option-ext/src/impl.rs +20 -0
- package/third-party/option-ext/src/lib.rs +71 -0
- package/assets/bg.png +0 -0
- package/assets/bg1.png +0 -0
- package/assets/bluma.png +0 -0
- package/assets/image.png +0 -0
- package/dist/assets/bg.png +0 -0
- package/dist/assets/bg1.png +0 -0
- package/dist/assets/bluma.png +0 -0
- package/dist/assets/image.png +0 -0
- package/dist/config/native_tools.json +0 -1151
- package/dist/config/plan_mode_instructions.md +0 -218
- package/dist/config/skills/factorai-sh/SKILL.md +0 -98
- package/dist/config/skills/git-commit/LICENSE.txt +0 -18
- package/dist/config/skills/git-commit/SKILL.md +0 -300
- package/dist/config/skills/git-commit/references/REFERENCE.md +0 -253
- package/dist/config/skills/git-commit/scripts/validate_commit_msg.py +0 -163
- package/dist/config/skills/git-pr/LICENSE.txt +0 -18
- package/dist/config/skills/git-pr/SKILL.md +0 -293
- package/dist/config/skills/git-pr/references/REFERENCE.md +0 -256
- package/dist/config/skills/git-pr/scripts/validate_commits.py +0 -120
- package/dist/config/skills/git-release/LICENSE.txt +0 -18
- package/dist/config/skills/git-release/SKILL.md +0 -408
- package/dist/config/skills/pdf/LICENSE.txt +0 -26
- package/dist/config/skills/pdf/SKILL.md +0 -736
- package/dist/config/skills/pdf/references/DOCUMENT_TYPES.md +0 -59
- package/dist/config/skills/pdf/references/FORMS.md +0 -69
- package/dist/config/skills/pdf/references/REFERENCE.md +0 -52
- package/dist/config/skills/pdf/scripts/__pycache__/create_report.cpython-312.pyc +0 -0
- package/dist/config/skills/pdf/scripts/create_report.py +0 -936
- package/dist/config/skills/pdf/scripts/merge_pdfs.py +0 -48
- package/dist/config/skills/skill-creator/LICENSE.txt +0 -26
- package/dist/config/skills/skill-creator/SKILL.md +0 -229
- package/dist/config/skills/xlsx/LICENSE.txt +0 -18
- package/dist/config/skills/xlsx/SKILL.md +0 -340
- package/dist/config/skills/xlsx/references/REFERENCE.md +0 -337
- package/dist/config/skills/xlsx/scripts/office/__init__.py +0 -2
- package/dist/config/skills/xlsx/scripts/office/pack.py +0 -58
- package/dist/config/skills/xlsx/scripts/office/soffice.py +0 -180
- package/dist/config/skills/xlsx/scripts/office/unpack.py +0 -63
- package/dist/config/skills/xlsx/scripts/office/validate.py +0 -122
- package/dist/config/skills/xlsx/scripts/recalc.py +0 -152
- package/dist/main.js +0 -47918
- package/dist/native/bluma-clipboard.linux-x64-gnu.node +0 -0
- package/dist/native/index.d.ts +0 -38
- package/dist/native/index.js +0 -319
- package/dist/native/package.json +0 -38
- package/dist/scaffold/.eslintrc.json +0 -3
- package/dist/scaffold/app/globals.css +0 -46
- package/dist/scaffold/app/layout.tsx +0 -19
- package/dist/scaffold/app/page.tsx +0 -124
- package/dist/scaffold/components/ui/README.md +0 -12
- package/dist/scaffold/components/ui/accordion.jsx +0 -42
- package/dist/scaffold/components/ui/alert-dialog.jsx +0 -80
- package/dist/scaffold/components/ui/alert.jsx +0 -33
- package/dist/scaffold/components/ui/aspect-ratio.jsx +0 -5
- package/dist/scaffold/components/ui/avatar.jsx +0 -28
- package/dist/scaffold/components/ui/badge.jsx +0 -24
- package/dist/scaffold/components/ui/breadcrumb.jsx +0 -72
- package/dist/scaffold/components/ui/button.jsx +0 -40
- package/dist/scaffold/components/ui/calendar.jsx +0 -56
- package/dist/scaffold/components/ui/card.jsx +0 -38
- package/dist/scaffold/components/ui/carousel.jsx +0 -168
- package/dist/scaffold/components/ui/chart.jsx +0 -76
- package/dist/scaffold/components/ui/checkbox.jsx +0 -22
- package/dist/scaffold/components/ui/collapsible.jsx +0 -7
- package/dist/scaffold/components/ui/command.jsx +0 -100
- package/dist/scaffold/components/ui/context-menu.jsx +0 -137
- package/dist/scaffold/components/ui/dialog.jsx +0 -72
- package/dist/scaffold/components/ui/drawer.jsx +0 -68
- package/dist/scaffold/components/ui/dropdown-menu.jsx +0 -143
- package/dist/scaffold/components/ui/form.jsx +0 -88
- package/dist/scaffold/components/ui/hover-card.jsx +0 -22
- package/dist/scaffold/components/ui/input-otp.jsx +0 -49
- package/dist/scaffold/components/ui/input.jsx +0 -19
- package/dist/scaffold/components/ui/label.jsx +0 -15
- package/dist/scaffold/components/ui/menubar.jsx +0 -161
- package/dist/scaffold/components/ui/navigation-menu.jsx +0 -95
- package/dist/scaffold/components/ui/pagination.jsx +0 -77
- package/dist/scaffold/components/ui/popover.jsx +0 -25
- package/dist/scaffold/components/ui/progress.jsx +0 -19
- package/dist/scaffold/components/ui/radio-group.jsx +0 -29
- package/dist/scaffold/components/ui/resizable.jsx +0 -27
- package/dist/scaffold/components/ui/scroll-area.jsx +0 -31
- package/dist/scaffold/components/ui/select.jsx +0 -117
- package/dist/scaffold/components/ui/separator.jsx +0 -22
- package/dist/scaffold/components/ui/sheet.jsx +0 -81
- package/dist/scaffold/components/ui/skeleton.jsx +0 -7
- package/dist/scaffold/components/ui/slider.jsx +0 -19
- package/dist/scaffold/components/ui/sonner.jsx +0 -22
- package/dist/scaffold/components/ui/switch.jsx +0 -23
- package/dist/scaffold/components/ui/table.jsx +0 -61
- package/dist/scaffold/components/ui/tabs.jsx +0 -43
- package/dist/scaffold/components/ui/textarea.jsx +0 -18
- package/dist/scaffold/components/ui/toast.jsx +0 -85
- package/dist/scaffold/components/ui/toaster.jsx +0 -33
- package/dist/scaffold/components/ui/toggle-group.jsx +0 -41
- package/dist/scaffold/components/ui/toggle.jsx +0 -30
- package/dist/scaffold/components/ui/tooltip.jsx +0 -22
- package/dist/scaffold/hooks/use-toast.ts +0 -101
- package/dist/scaffold/lib/utils.ts +0 -6
- package/dist/scaffold/next.config.js +0 -5
- package/dist/scaffold/next.config.mjs +0 -15
- package/dist/scaffold/next.config.ts +0 -19
- package/dist/scaffold/package.json +0 -70
- package/dist/scaffold/postcss.config.js +0 -6
- package/dist/scaffold/tailwind.config.ts +0 -57
- package/dist/scaffold/tsconfig.json +0 -20
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Validate the internal structure of Office Open XML files.
|
|
3
|
-
|
|
4
|
-
Checks that required parts exist, relationships are consistent,
|
|
5
|
-
and the ZIP structure is well-formed. Does NOT validate against
|
|
6
|
-
full ISO/IEC 29500 schemas (that would require lxml + full schema set).
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
import os
|
|
10
|
-
import zipfile
|
|
11
|
-
|
|
12
|
-
REQUIRED_PARTS_XLSX = [
|
|
13
|
-
'[Content_Types].xml',
|
|
14
|
-
'_rels/.rels',
|
|
15
|
-
'xl/workbook.xml',
|
|
16
|
-
'xl/_rels/workbook.xml.rels',
|
|
17
|
-
'xl/styles.xml',
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
REQUIRED_PARTS_DOCX = [
|
|
21
|
-
'[Content_Types].xml',
|
|
22
|
-
'_rels/.rels',
|
|
23
|
-
'word/document.xml',
|
|
24
|
-
'word/_rels/document.xml.rels',
|
|
25
|
-
'word/styles.xml',
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
REQUIRED_PARTS_PPTX = [
|
|
29
|
-
'[Content_Types].xml',
|
|
30
|
-
'_rels/.rels',
|
|
31
|
-
'ppt/presentation.xml',
|
|
32
|
-
'ppt/_rels/presentation.xml.rels',
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
FILE_TYPE_MAP = {
|
|
36
|
-
'.xlsx': ('xlsx', REQUIRED_PARTS_XLSX),
|
|
37
|
-
'.xlsm': ('xlsx', REQUIRED_PARTS_XLSX),
|
|
38
|
-
'.docx': ('docx', REQUIRED_PARTS_DOCX),
|
|
39
|
-
'.pptx': ('pptx', REQUIRED_PARTS_PPTX),
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def validate(filepath: str) -> dict:
|
|
44
|
-
"""
|
|
45
|
-
Validate an Office file's internal structure.
|
|
46
|
-
|
|
47
|
-
Returns a dict with:
|
|
48
|
-
- valid (bool): Whether the file passes validation
|
|
49
|
-
- file_type (str): Detected type (xlsx/docx/pptx)
|
|
50
|
-
- parts_count (int): Number of parts in the archive
|
|
51
|
-
- missing_parts (list): Required parts that are missing
|
|
52
|
-
- warnings (list): Non-critical issues
|
|
53
|
-
- errors (list): Critical issues
|
|
54
|
-
"""
|
|
55
|
-
abs_path = os.path.abspath(filepath)
|
|
56
|
-
ext = os.path.splitext(abs_path)[1].lower()
|
|
57
|
-
|
|
58
|
-
result = {
|
|
59
|
-
'valid': True,
|
|
60
|
-
'file_type': None,
|
|
61
|
-
'parts_count': 0,
|
|
62
|
-
'missing_parts': [],
|
|
63
|
-
'warnings': [],
|
|
64
|
-
'errors': [],
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if not os.path.isfile(abs_path):
|
|
68
|
-
result['valid'] = False
|
|
69
|
-
result['errors'].append(f'File not found: {abs_path}')
|
|
70
|
-
return result
|
|
71
|
-
|
|
72
|
-
if ext not in FILE_TYPE_MAP:
|
|
73
|
-
result['valid'] = False
|
|
74
|
-
result['errors'].append(f'Unsupported extension: {ext}')
|
|
75
|
-
return result
|
|
76
|
-
|
|
77
|
-
file_type, required_parts = FILE_TYPE_MAP[ext]
|
|
78
|
-
result['file_type'] = file_type
|
|
79
|
-
|
|
80
|
-
try:
|
|
81
|
-
with zipfile.ZipFile(abs_path, 'r') as zf:
|
|
82
|
-
names = set(zf.namelist())
|
|
83
|
-
result['parts_count'] = len(names)
|
|
84
|
-
|
|
85
|
-
for part in required_parts:
|
|
86
|
-
if part not in names:
|
|
87
|
-
result['missing_parts'].append(part)
|
|
88
|
-
|
|
89
|
-
corrupt = zf.testzip()
|
|
90
|
-
if corrupt:
|
|
91
|
-
result['errors'].append(f'Corrupt entry: {corrupt}')
|
|
92
|
-
|
|
93
|
-
except zipfile.BadZipFile:
|
|
94
|
-
result['valid'] = False
|
|
95
|
-
result['errors'].append('Not a valid ZIP file')
|
|
96
|
-
return result
|
|
97
|
-
except Exception as e:
|
|
98
|
-
result['valid'] = False
|
|
99
|
-
result['errors'].append(f'Error reading file: {str(e)}')
|
|
100
|
-
return result
|
|
101
|
-
|
|
102
|
-
if result['missing_parts']:
|
|
103
|
-
result['valid'] = False
|
|
104
|
-
result['errors'].append(
|
|
105
|
-
f"Missing {len(result['missing_parts'])} required part(s)"
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
for name in names:
|
|
109
|
-
if name.startswith('..') or '/../' in name:
|
|
110
|
-
result['valid'] = False
|
|
111
|
-
result['errors'].append(f'Path traversal detected: {name}')
|
|
112
|
-
|
|
113
|
-
if result['parts_count'] == 0:
|
|
114
|
-
result['valid'] = False
|
|
115
|
-
result['errors'].append('Archive is empty')
|
|
116
|
-
|
|
117
|
-
if result['parts_count'] > 10000:
|
|
118
|
-
result['warnings'].append(
|
|
119
|
-
f'Unusually large archive: {result["parts_count"]} entries'
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
return result
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Recalculate all formulas in an Excel file using LibreOffice and scan
|
|
4
|
-
for formula errors.
|
|
5
|
-
|
|
6
|
-
Usage:
|
|
7
|
-
python recalc.py <excel_file> [timeout_seconds]
|
|
8
|
-
|
|
9
|
-
Returns JSON to stdout with recalculation status and any errors found.
|
|
10
|
-
Requires LibreOffice installed and openpyxl for error scanning.
|
|
11
|
-
|
|
12
|
-
Exit codes:
|
|
13
|
-
0 Recalculated successfully (may still have formula errors)
|
|
14
|
-
1 Recalculation failed
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
import json
|
|
18
|
-
import os
|
|
19
|
-
import sys
|
|
20
|
-
import time
|
|
21
|
-
|
|
22
|
-
MIN_PYTHON = (3, 10)
|
|
23
|
-
if sys.version_info < MIN_PYTHON:
|
|
24
|
-
print(
|
|
25
|
-
f"Error: Python {'.'.join(map(str, MIN_PYTHON))}+ is required "
|
|
26
|
-
f"(found {'.'.join(map(str, sys.version_info[:3]))})",
|
|
27
|
-
file=sys.stderr,
|
|
28
|
-
)
|
|
29
|
-
sys.exit(1)
|
|
30
|
-
|
|
31
|
-
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
32
|
-
sys.path.insert(0, SCRIPT_DIR)
|
|
33
|
-
|
|
34
|
-
from office.soffice import find_soffice, run_soffice_recalc
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ERROR_VALUES = frozenset({
|
|
38
|
-
'#REF!', '#DIV/0!', '#VALUE!', '#N/A', '#NAME?',
|
|
39
|
-
'#NULL!', '#NUM!', '#GETTING_DATA', '#SPILL!', '#CALC!',
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def scan_errors_fast(filepath: str) -> dict:
|
|
44
|
-
"""Optimized error scanning — loads formula workbook only once."""
|
|
45
|
-
try:
|
|
46
|
-
from openpyxl import load_workbook
|
|
47
|
-
except ImportError:
|
|
48
|
-
return {
|
|
49
|
-
'status': 'error',
|
|
50
|
-
'message': 'openpyxl not installed — cannot scan for formula errors',
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
wb_data = load_workbook(filepath, data_only=True)
|
|
54
|
-
wb_formula = load_workbook(filepath)
|
|
55
|
-
|
|
56
|
-
errors = {}
|
|
57
|
-
total_formulas = 0
|
|
58
|
-
sheets_processed = []
|
|
59
|
-
|
|
60
|
-
for sheet_name in wb_data.sheetnames:
|
|
61
|
-
ws_data = wb_data[sheet_name]
|
|
62
|
-
ws_form = wb_formula[sheet_name]
|
|
63
|
-
sheets_processed.append(sheet_name)
|
|
64
|
-
|
|
65
|
-
for row_data, row_form in zip(ws_data.iter_rows(), ws_form.iter_rows()):
|
|
66
|
-
for cell_data, cell_form in zip(row_data, row_form):
|
|
67
|
-
if isinstance(cell_form.value, str) and cell_form.value.startswith('='):
|
|
68
|
-
total_formulas += 1
|
|
69
|
-
|
|
70
|
-
if isinstance(cell_data.value, str) and cell_data.value in ERROR_VALUES:
|
|
71
|
-
err_type = cell_data.value
|
|
72
|
-
if err_type not in errors:
|
|
73
|
-
errors[err_type] = {'count': 0, 'locations': []}
|
|
74
|
-
errors[err_type]['count'] += 1
|
|
75
|
-
loc = f"{sheet_name}!{cell_data.coordinate}"
|
|
76
|
-
if len(errors[err_type]['locations']) < 20:
|
|
77
|
-
errors[err_type]['locations'].append(loc)
|
|
78
|
-
|
|
79
|
-
wb_data.close()
|
|
80
|
-
wb_formula.close()
|
|
81
|
-
|
|
82
|
-
total_errors = sum(e['count'] for e in errors.values())
|
|
83
|
-
|
|
84
|
-
result = {
|
|
85
|
-
'total_formulas': total_formulas,
|
|
86
|
-
'total_errors': total_errors,
|
|
87
|
-
'sheets_processed': sheets_processed,
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if total_errors > 0:
|
|
91
|
-
result['status'] = 'errors_found'
|
|
92
|
-
result['error_summary'] = errors
|
|
93
|
-
else:
|
|
94
|
-
result['status'] = 'success'
|
|
95
|
-
|
|
96
|
-
return result
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def main():
|
|
100
|
-
if len(sys.argv) < 2:
|
|
101
|
-
print(json.dumps({
|
|
102
|
-
'status': 'error',
|
|
103
|
-
'message': 'Usage: python recalc.py <excel_file> [timeout_seconds]',
|
|
104
|
-
}))
|
|
105
|
-
sys.exit(1)
|
|
106
|
-
|
|
107
|
-
filepath = os.path.abspath(sys.argv[1])
|
|
108
|
-
timeout = int(sys.argv[2]) if len(sys.argv) > 2 else 60
|
|
109
|
-
|
|
110
|
-
if not os.path.isfile(filepath):
|
|
111
|
-
print(json.dumps({
|
|
112
|
-
'status': 'error',
|
|
113
|
-
'message': f'File not found: {filepath}',
|
|
114
|
-
}))
|
|
115
|
-
sys.exit(1)
|
|
116
|
-
|
|
117
|
-
soffice_path = find_soffice()
|
|
118
|
-
if not soffice_path:
|
|
119
|
-
print(json.dumps({
|
|
120
|
-
'status': 'error',
|
|
121
|
-
'message': (
|
|
122
|
-
'LibreOffice not found. Install it with: '
|
|
123
|
-
'sudo apt install libreoffice-calc (Linux) or '
|
|
124
|
-
'brew install --cask libreoffice (macOS)'
|
|
125
|
-
),
|
|
126
|
-
}))
|
|
127
|
-
sys.exit(1)
|
|
128
|
-
|
|
129
|
-
start = time.time()
|
|
130
|
-
|
|
131
|
-
success, message = run_soffice_recalc(soffice_path, filepath, timeout)
|
|
132
|
-
|
|
133
|
-
elapsed = round(time.time() - start, 2)
|
|
134
|
-
|
|
135
|
-
if not success:
|
|
136
|
-
print(json.dumps({
|
|
137
|
-
'status': 'error',
|
|
138
|
-
'message': message,
|
|
139
|
-
'elapsed_seconds': elapsed,
|
|
140
|
-
}))
|
|
141
|
-
sys.exit(1)
|
|
142
|
-
|
|
143
|
-
result = scan_errors_fast(filepath)
|
|
144
|
-
result['elapsed_seconds'] = elapsed
|
|
145
|
-
result['recalc_engine'] = 'LibreOffice'
|
|
146
|
-
|
|
147
|
-
print(json.dumps(result, indent=2))
|
|
148
|
-
sys.exit(0)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if __name__ == '__main__':
|
|
152
|
-
main()
|