pomera-ai-commander 1.2.1 → 1.2.2
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/core/backup_recovery_manager.py +169 -3
- package/core/data_directory.py +549 -0
- package/core/diff_utils.py +239 -0
- package/core/efficient_line_numbers.py +30 -0
- package/core/mcp/find_replace_diff.py +334 -0
- package/core/mcp/tool_registry.py +330 -3
- package/core/memento.py +275 -0
- package/mcp.json +1 -1
- package/migrate_data.py +127 -0
- package/package.json +5 -2
- package/pomera.py +411 -10
- package/pomera_mcp_server.py +2 -2
- package/requirements.txt +1 -0
- package/scripts/Dockerfile.alpine +43 -0
- package/scripts/Dockerfile.gui-test +54 -0
- package/scripts/Dockerfile.linux +43 -0
- package/scripts/Dockerfile.test-linux +80 -0
- package/scripts/Dockerfile.ubuntu +39 -0
- package/scripts/README.md +53 -0
- package/scripts/build-all.bat +113 -0
- package/scripts/build-docker.bat +53 -0
- package/scripts/build-docker.sh +55 -0
- package/scripts/build-optimized.bat +101 -0
- package/scripts/build.sh +78 -0
- package/scripts/docker-compose.test.yml +27 -0
- package/scripts/docker-compose.yml +32 -0
- package/scripts/postinstall.js +62 -0
- package/scripts/requirements-minimal.txt +33 -0
- package/scripts/test-linux-simple.bat +28 -0
- package/scripts/validate-release-workflow.py +450 -0
- package/tools/diff_viewer.py +797 -52
- package/tools/find_replace.py +551 -12
- package/tools/notes_widget.py +8 -3
- package/tools/regex_extractor.py +5 -5
package/scripts/build.sh
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
echo "Building Pomera AI Commander with PyInstaller..."
|
|
4
|
+
echo
|
|
5
|
+
|
|
6
|
+
# Check if Python is installed
|
|
7
|
+
if ! command -v python3 &> /dev/null; then
|
|
8
|
+
echo "ERROR: Python 3 is not installed or not in PATH"
|
|
9
|
+
echo "Please install Python 3.8+ and try again"
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
# Check if PyInstaller is installed
|
|
14
|
+
if ! python3 -c "import PyInstaller" &> /dev/null; then
|
|
15
|
+
echo "PyInstaller not found. Installing..."
|
|
16
|
+
pip3 install pyinstaller
|
|
17
|
+
if [ $? -ne 0 ]; then
|
|
18
|
+
echo "ERROR: Failed to install PyInstaller"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Install requirements if requirements.txt exists
|
|
24
|
+
if [ -f "requirements.txt" ]; then
|
|
25
|
+
echo "Installing requirements..."
|
|
26
|
+
pip3 install -r requirements.txt
|
|
27
|
+
if [ $? -ne 0 ]; then
|
|
28
|
+
echo "ERROR: Failed to install requirements"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Install additional AI SDK dependencies (may fail gracefully)
|
|
34
|
+
echo "Installing additional AI SDK dependencies..."
|
|
35
|
+
pip3 install google-genai>=1.0.0 2>/dev/null || echo "google-genai installation skipped"
|
|
36
|
+
pip3 install azure-ai-inference>=1.0.0b1 azure-core>=1.30.0 2>/dev/null || echo "azure-ai-inference installation skipped"
|
|
37
|
+
pip3 install tenacity>=8.2.0 2>/dev/null || echo "tenacity installation skipped"
|
|
38
|
+
pip3 install aiohttp>=3.9.0 2>/dev/null || echo "aiohttp installation skipped"
|
|
39
|
+
echo "AI SDK dependencies installation completed."
|
|
40
|
+
|
|
41
|
+
# Clean previous build
|
|
42
|
+
rm -rf build dist
|
|
43
|
+
|
|
44
|
+
echo
|
|
45
|
+
echo "Building executable with PyInstaller..."
|
|
46
|
+
echo "Command: pyinstaller --onedir [with many exclusions] --name pomera pomera.py"
|
|
47
|
+
|
|
48
|
+
python3 -m PyInstaller --onedir --exclude-module pytest --exclude-module test --exclude-module tests --exclude-module matplotlib --exclude-module scipy --exclude-module pandas --exclude-module jupyter --exclude-module IPython --exclude-module torch --exclude-module torchvision --exclude-module torchaudio --exclude-module tensorflow --exclude-module sklearn --exclude-module cv2 --exclude-module numpy --exclude-module pygame --exclude-module nltk --exclude-module spacy --exclude-module yt_dlp --exclude-module transformers --exclude-module boto3 --exclude-module botocore --exclude-module grpc --exclude-module onnxruntime --exclude-module opentelemetry --exclude-module timm --exclude-module emoji --exclude-module pygments --exclude-module jinja2 --exclude-module anyio --exclude-module orjson --exclude-module uvicorn --exclude-module fsspec --exclude-module websockets --exclude-module psutil --exclude-module regex --name pomera pomera.py
|
|
49
|
+
|
|
50
|
+
if [ $? -ne 0 ]; then
|
|
51
|
+
echo
|
|
52
|
+
echo "ERROR: Build failed!"
|
|
53
|
+
echo "Check the output above for error details"
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
echo
|
|
58
|
+
echo "Build completed successfully!"
|
|
59
|
+
echo
|
|
60
|
+
echo "Executable location: dist/pomera/pomera"
|
|
61
|
+
echo
|
|
62
|
+
echo "To run the application:"
|
|
63
|
+
echo " cd dist/pomera"
|
|
64
|
+
echo " ./pomera"
|
|
65
|
+
echo
|
|
66
|
+
|
|
67
|
+
# Optional: Test the executable
|
|
68
|
+
read -p "Do you want to test the executable now? (y/n): " test
|
|
69
|
+
if [[ $test == "y" || $test == "Y" ]]; then
|
|
70
|
+
echo
|
|
71
|
+
echo "Testing executable..."
|
|
72
|
+
cd dist/pomera
|
|
73
|
+
./pomera &
|
|
74
|
+
cd ../..
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
echo
|
|
78
|
+
echo "Build process complete!"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
# Linux GUI environment for testing
|
|
5
|
+
linux-test:
|
|
6
|
+
build:
|
|
7
|
+
context: .
|
|
8
|
+
dockerfile: Dockerfile.test-linux
|
|
9
|
+
ports:
|
|
10
|
+
- "6080:6080" # noVNC web interface
|
|
11
|
+
- "5901:5901" # VNC direct connection
|
|
12
|
+
volumes:
|
|
13
|
+
- ./dist-docker:/home/testuser/app:ro # Mount your executable
|
|
14
|
+
environment:
|
|
15
|
+
- DISPLAY=:1
|
|
16
|
+
stdin_open: true
|
|
17
|
+
tty: true
|
|
18
|
+
|
|
19
|
+
# Alternative: Simple command-line testing
|
|
20
|
+
linux-cli:
|
|
21
|
+
image: ubuntu:22.04
|
|
22
|
+
volumes:
|
|
23
|
+
- ./dist-docker:/app:ro
|
|
24
|
+
working_dir: /app
|
|
25
|
+
command: /bin/bash
|
|
26
|
+
stdin_open: true
|
|
27
|
+
tty: true
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
# Build for Ubuntu/Debian-based systems
|
|
5
|
+
build-ubuntu:
|
|
6
|
+
build:
|
|
7
|
+
context: .
|
|
8
|
+
dockerfile: Dockerfile.ubuntu
|
|
9
|
+
volumes:
|
|
10
|
+
- ./dist-docker:/output
|
|
11
|
+
environment:
|
|
12
|
+
- BUILD_TARGET=ubuntu
|
|
13
|
+
|
|
14
|
+
# Build for Alpine Linux (smaller, static)
|
|
15
|
+
build-alpine:
|
|
16
|
+
build:
|
|
17
|
+
context: .
|
|
18
|
+
dockerfile: Dockerfile.alpine
|
|
19
|
+
volumes:
|
|
20
|
+
- ./dist-docker:/output
|
|
21
|
+
environment:
|
|
22
|
+
- BUILD_TARGET=alpine
|
|
23
|
+
|
|
24
|
+
# Build for CentOS/RHEL-based systems
|
|
25
|
+
build-centos:
|
|
26
|
+
build:
|
|
27
|
+
context: .
|
|
28
|
+
dockerfile: Dockerfile.centos
|
|
29
|
+
volumes:
|
|
30
|
+
- ./dist-docker:/output
|
|
31
|
+
environment:
|
|
32
|
+
- BUILD_TARGET=centos
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Pomera AI Commander - npm postinstall script
|
|
4
|
+
*
|
|
5
|
+
* This script runs after npm install/update and checks for
|
|
6
|
+
* databases in the package directory that might be at risk.
|
|
7
|
+
*
|
|
8
|
+
* Displays a warning if portable mode data is detected.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
// Package root directory
|
|
15
|
+
const packageDir = path.join(__dirname, '..');
|
|
16
|
+
|
|
17
|
+
// Check for databases in package directory
|
|
18
|
+
const databases = ['settings.db', 'notes.db', 'settings.json'];
|
|
19
|
+
const foundDatabases = [];
|
|
20
|
+
|
|
21
|
+
databases.forEach(db => {
|
|
22
|
+
const dbPath = path.join(packageDir, db);
|
|
23
|
+
if (fs.existsSync(dbPath)) {
|
|
24
|
+
const stats = fs.statSync(dbPath);
|
|
25
|
+
foundDatabases.push({
|
|
26
|
+
name: db,
|
|
27
|
+
path: dbPath,
|
|
28
|
+
size: stats.size
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// If databases found in package directory, show warning
|
|
34
|
+
if (foundDatabases.length > 0) {
|
|
35
|
+
console.log('\n' + '='.repeat(70));
|
|
36
|
+
console.log('⚠️ POMERA DATA WARNING ⚠️');
|
|
37
|
+
console.log('='.repeat(70));
|
|
38
|
+
console.log('\nData files detected in package directory (portable mode):');
|
|
39
|
+
foundDatabases.forEach(db => {
|
|
40
|
+
console.log(` • ${db.name} (${(db.size / 1024).toFixed(1)} KB)`);
|
|
41
|
+
});
|
|
42
|
+
console.log('\n🚨 IMPORTANT:');
|
|
43
|
+
console.log(' These files WILL BE DELETED if you run "npm update"!');
|
|
44
|
+
console.log('\n📋 BEFORE UPDATING, please:');
|
|
45
|
+
console.log(' 1. Export your settings: Help > Export Settings');
|
|
46
|
+
console.log(' 2. Copy database files to a safe location:');
|
|
47
|
+
console.log(` ${packageDir}`);
|
|
48
|
+
console.log('\n💡 RECOMMENDED: Use platform data directories instead of portable mode.');
|
|
49
|
+
console.log(' Run Pomera without --portable flag to store data in:');
|
|
50
|
+
if (process.platform === 'win32') {
|
|
51
|
+
console.log(' %LOCALAPPDATA%\\PomeraAI\\Pomera-AI-Commander\\');
|
|
52
|
+
} else if (process.platform === 'darwin') {
|
|
53
|
+
console.log(' ~/Library/Application Support/Pomera-AI-Commander/');
|
|
54
|
+
} else {
|
|
55
|
+
console.log(' ~/.local/share/Pomera-AI-Commander/');
|
|
56
|
+
}
|
|
57
|
+
console.log('\n' + '='.repeat(70) + '\n');
|
|
58
|
+
} else {
|
|
59
|
+
// No databases in package directory - safe configuration
|
|
60
|
+
console.log('✅ Pomera AI Commander installed successfully.');
|
|
61
|
+
console.log(' Data will be stored in platform-appropriate directory (safe from updates).');
|
|
62
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Minimal requirements for Pomera AI Commander
|
|
2
|
+
# Only the absolutely essential libraries
|
|
3
|
+
|
|
4
|
+
# Core GUI and functionality
|
|
5
|
+
requests>=2.25.0
|
|
6
|
+
reportlab>=3.6.0
|
|
7
|
+
python-docx>=0.8.11
|
|
8
|
+
aiohttp>=3.9.0
|
|
9
|
+
|
|
10
|
+
# AI Tools (optional but core feature)
|
|
11
|
+
huggingface-hub>=0.16.0
|
|
12
|
+
|
|
13
|
+
# Google AI SDK (recommended for better error handling and streaming)
|
|
14
|
+
google-genai>=1.0.0
|
|
15
|
+
|
|
16
|
+
# Azure AI SDK (recommended - Microsoft recommends migrating to this)
|
|
17
|
+
azure-ai-inference>=1.0.0b1
|
|
18
|
+
azure-core>=1.30.0
|
|
19
|
+
|
|
20
|
+
# Retry logic with exponential backoff
|
|
21
|
+
tenacity>=8.2.0
|
|
22
|
+
|
|
23
|
+
# Encryption for AI tools
|
|
24
|
+
cryptography>=3.4.0
|
|
25
|
+
|
|
26
|
+
# Image processing (required by reportlab)
|
|
27
|
+
Pillow>=8.0.0
|
|
28
|
+
|
|
29
|
+
# XML processing (required by python-docx)
|
|
30
|
+
lxml>=4.6.0
|
|
31
|
+
|
|
32
|
+
# Build tool
|
|
33
|
+
pyinstaller>=5.0.0
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
echo Testing Linux executable in Docker container...
|
|
3
|
+
echo.
|
|
4
|
+
|
|
5
|
+
REM Check if the Linux executable exists
|
|
6
|
+
if not exist "dist-docker\pomera-linux" (
|
|
7
|
+
echo ERROR: Linux executable not found!
|
|
8
|
+
echo Please build it first using: build-docker.bat
|
|
9
|
+
pause
|
|
10
|
+
exit /b 1
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
echo Starting Ubuntu container with your Linux executable...
|
|
14
|
+
echo.
|
|
15
|
+
echo Commands you can try inside the container:
|
|
16
|
+
echo ./pomera-linux --help
|
|
17
|
+
echo ./pomera-linux --version
|
|
18
|
+
echo ls -la pomera-linux
|
|
19
|
+
echo file pomera-linux
|
|
20
|
+
echo.
|
|
21
|
+
echo Type 'exit' to return to Windows
|
|
22
|
+
echo.
|
|
23
|
+
|
|
24
|
+
docker run -it --rm -v "%cd%\dist-docker:/app" -w /app ubuntu:22.04 /bin/bash
|
|
25
|
+
|
|
26
|
+
echo.
|
|
27
|
+
echo Returned to Windows
|
|
28
|
+
pause
|