praisonaiwp 1.4.2__tar.gz

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.
Files changed (106) hide show
  1. praisonaiwp-1.4.2/.env.example +24 -0
  2. praisonaiwp-1.4.2/.github/workflows/test.yml +154 -0
  3. praisonaiwp-1.4.2/.gitignore +59 -0
  4. praisonaiwp-1.4.2/.python-version +1 -0
  5. praisonaiwp-1.4.2/AI_DOCUMENTATION.md +65 -0
  6. praisonaiwp-1.4.2/ARCHITECTURE.md +741 -0
  7. praisonaiwp-1.4.2/CHANGELOG.md +654 -0
  8. praisonaiwp-1.4.2/DEVELOPMENT.md +137 -0
  9. praisonaiwp-1.4.2/LICENSE +21 -0
  10. praisonaiwp-1.4.2/PKG-INFO +1940 -0
  11. praisonaiwp-1.4.2/PRAISONAI.md +1088 -0
  12. praisonaiwp-1.4.2/README.md +1883 -0
  13. praisonaiwp-1.4.2/RELEASE_CHECKLIST.md +176 -0
  14. praisonaiwp-1.4.2/RELEASE_NOTES_v1.1.0.md +262 -0
  15. praisonaiwp-1.4.2/TESTING.md +714 -0
  16. praisonaiwp-1.4.2/WPCLI.md +342 -0
  17. praisonaiwp-1.4.2/examples/bulk_update_9_pages.py +87 -0
  18. praisonaiwp-1.4.2/examples/create_single_post.py +56 -0
  19. praisonaiwp-1.4.2/examples/posts.json +20 -0
  20. praisonaiwp-1.4.2/examples/update_specific_line.py +96 -0
  21. praisonaiwp-1.4.2/examples/updates.json +20 -0
  22. praisonaiwp-1.4.2/praisonaiwp/__init__.py +16 -0
  23. praisonaiwp-1.4.2/praisonaiwp/__main__.py +8 -0
  24. praisonaiwp-1.4.2/praisonaiwp/__version__.py +1 -0
  25. praisonaiwp-1.4.2/praisonaiwp/ai/__init__.py +24 -0
  26. praisonaiwp-1.4.2/praisonaiwp/ai/integration.py +311 -0
  27. praisonaiwp-1.4.2/praisonaiwp/ai/smart_agent.py +277 -0
  28. praisonaiwp-1.4.2/praisonaiwp/ai/tools/__init__.py +5 -0
  29. praisonaiwp-1.4.2/praisonaiwp/ai/tools/wordpress_tools.py +98 -0
  30. praisonaiwp-1.4.2/praisonaiwp/ai/utils/__init__.py +21 -0
  31. praisonaiwp-1.4.2/praisonaiwp/ai/utils/cost_tracker.py +124 -0
  32. praisonaiwp-1.4.2/praisonaiwp/ai/utils/rate_limiter.py +81 -0
  33. praisonaiwp-1.4.2/praisonaiwp/ai/utils/retry.py +54 -0
  34. praisonaiwp-1.4.2/praisonaiwp/ai/utils/validators.py +122 -0
  35. praisonaiwp-1.4.2/praisonaiwp/cli/__init__.py +5 -0
  36. praisonaiwp-1.4.2/praisonaiwp/cli/commands/__init__.py +1 -0
  37. praisonaiwp-1.4.2/praisonaiwp/cli/commands/ai_commands.py +144 -0
  38. praisonaiwp-1.4.2/praisonaiwp/cli/commands/category.py +385 -0
  39. praisonaiwp-1.4.2/praisonaiwp/cli/commands/create.py +359 -0
  40. praisonaiwp-1.4.2/praisonaiwp/cli/commands/find.py +137 -0
  41. praisonaiwp-1.4.2/praisonaiwp/cli/commands/find_wordpress.py +117 -0
  42. praisonaiwp-1.4.2/praisonaiwp/cli/commands/init.py +137 -0
  43. praisonaiwp-1.4.2/praisonaiwp/cli/commands/install_wp_cli.py +104 -0
  44. praisonaiwp-1.4.2/praisonaiwp/cli/commands/list.py +100 -0
  45. praisonaiwp-1.4.2/praisonaiwp/cli/commands/mcp_commands.py +320 -0
  46. praisonaiwp-1.4.2/praisonaiwp/cli/commands/media.py +107 -0
  47. praisonaiwp-1.4.2/praisonaiwp/cli/commands/plugin.py +201 -0
  48. praisonaiwp-1.4.2/praisonaiwp/cli/commands/update.py +287 -0
  49. praisonaiwp-1.4.2/praisonaiwp/cli/main.py +182 -0
  50. praisonaiwp-1.4.2/praisonaiwp/core/__init__.py +7 -0
  51. praisonaiwp-1.4.2/praisonaiwp/core/config.py +220 -0
  52. praisonaiwp-1.4.2/praisonaiwp/core/config_migration.py +102 -0
  53. praisonaiwp-1.4.2/praisonaiwp/core/router.py +132 -0
  54. praisonaiwp-1.4.2/praisonaiwp/core/ssh_manager.py +216 -0
  55. praisonaiwp-1.4.2/praisonaiwp/core/wp_client.py +1373 -0
  56. praisonaiwp-1.4.2/praisonaiwp/core/wp_finder.py +314 -0
  57. praisonaiwp-1.4.2/praisonaiwp/core/wp_installer.py +334 -0
  58. praisonaiwp-1.4.2/praisonaiwp/editors/__init__.py +5 -0
  59. praisonaiwp-1.4.2/praisonaiwp/editors/content_editor.py +190 -0
  60. praisonaiwp-1.4.2/praisonaiwp/mcp/__init__.py +13 -0
  61. praisonaiwp-1.4.2/praisonaiwp/mcp/prompts.py +196 -0
  62. praisonaiwp-1.4.2/praisonaiwp/mcp/resources.py +190 -0
  63. praisonaiwp-1.4.2/praisonaiwp/mcp/server.py +243 -0
  64. praisonaiwp-1.4.2/praisonaiwp/mcp/tools.py +689 -0
  65. praisonaiwp-1.4.2/praisonaiwp/parallel/__init__.py +5 -0
  66. praisonaiwp-1.4.2/praisonaiwp/parallel/executor.py +121 -0
  67. praisonaiwp-1.4.2/praisonaiwp/parallel/nodejs/README.md +73 -0
  68. praisonaiwp-1.4.2/praisonaiwp/parallel/nodejs/index.js +180 -0
  69. praisonaiwp-1.4.2/praisonaiwp/parallel/nodejs/package.json +21 -0
  70. praisonaiwp-1.4.2/praisonaiwp/utils/__init__.py +20 -0
  71. praisonaiwp-1.4.2/praisonaiwp/utils/block_converter.py +256 -0
  72. praisonaiwp-1.4.2/praisonaiwp/utils/exceptions.py +31 -0
  73. praisonaiwp-1.4.2/praisonaiwp/utils/logger.py +51 -0
  74. praisonaiwp-1.4.2/praisonaiwp/utils/markdown_converter.py +129 -0
  75. praisonaiwp-1.4.2/pyproject.toml +141 -0
  76. praisonaiwp-1.4.2/requirements-dev.txt +7 -0
  77. praisonaiwp-1.4.2/requirements.txt +8 -0
  78. praisonaiwp-1.4.2/setup.py +56 -0
  79. praisonaiwp-1.4.2/test_real_server.py +343 -0
  80. praisonaiwp-1.4.2/test_ssh_config.py +44 -0
  81. praisonaiwp-1.4.2/tests/README_INTEGRATION_TESTS.md +206 -0
  82. praisonaiwp-1.4.2/tests/__init__.py +1 -0
  83. praisonaiwp-1.4.2/tests/ai/test_integration.py +198 -0
  84. praisonaiwp-1.4.2/tests/ai/test_integration_enhanced.py +201 -0
  85. praisonaiwp-1.4.2/tests/ai/test_utils.py +217 -0
  86. praisonaiwp-1.4.2/tests/ai/test_validators.py +113 -0
  87. praisonaiwp-1.4.2/tests/ai/test_wordpress_tools.py +120 -0
  88. praisonaiwp-1.4.2/tests/cli/test_ai_commands.py +246 -0
  89. praisonaiwp-1.4.2/tests/cli/test_ai_commands_simple.py +36 -0
  90. praisonaiwp-1.4.2/tests/cli/test_plugin_commands.py +211 -0
  91. praisonaiwp-1.4.2/tests/conftest.py +78 -0
  92. praisonaiwp-1.4.2/tests/mcp/__init__.py +1 -0
  93. praisonaiwp-1.4.2/tests/mcp/test_prompts.py +75 -0
  94. praisonaiwp-1.4.2/tests/mcp/test_resources.py +84 -0
  95. praisonaiwp-1.4.2/tests/mcp/test_server.py +95 -0
  96. praisonaiwp-1.4.2/tests/mcp/test_tools.py +266 -0
  97. praisonaiwp-1.4.2/tests/test_ai_router.py +237 -0
  98. praisonaiwp-1.4.2/tests/test_block_converter.py +526 -0
  99. praisonaiwp-1.4.2/tests/test_cli_integration.py +333 -0
  100. praisonaiwp-1.4.2/tests/test_config.py +157 -0
  101. praisonaiwp-1.4.2/tests/test_config_v2.py +252 -0
  102. praisonaiwp-1.4.2/tests/test_content_editor.py +137 -0
  103. praisonaiwp-1.4.2/tests/test_e2e_ai.py +172 -0
  104. praisonaiwp-1.4.2/tests/test_real_integration.py +140 -0
  105. praisonaiwp-1.4.2/tests/test_router.py +243 -0
  106. praisonaiwp-1.4.2/tests/test_wp_client.py +988 -0
@@ -0,0 +1,24 @@
1
+ # PraisonAIWP Environment Variables
2
+ # Copy this file to .env and fill in your values
3
+ # DO NOT commit .env to git (it's in .gitignore)
4
+
5
+ # Option 1: Use server name from config file
6
+ # PRAISONAIWP_SERVER=default
7
+
8
+ # Option 2: Set environment variables directly
9
+ # Required variables:
10
+ WP_HOSTNAME=your-server.com
11
+ WP_SSH_USER=your_ssh_username
12
+ WP_PATH=/var/www/html/wordpress
13
+
14
+ # Optional variables (with defaults):
15
+ # WP_SSH_KEY=~/.ssh/id_ed25519
16
+ # WP_SSH_PORT=22
17
+ # WP_PHP_BIN=php
18
+ # WP_CLI_BIN=/usr/local/bin/wp
19
+
20
+ # Example for Plesk servers:
21
+ # WP_PHP_BIN=/opt/plesk/php/8.3/bin/php
22
+
23
+ # Example for custom WordPress path:
24
+ # WP_PATH=/var/www/vhosts/example.com/httpdocs
@@ -0,0 +1,154 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest]
16
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install uv
27
+ run: |
28
+ curl -LsSf https://astral.sh/uv/install.sh | sh
29
+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
30
+
31
+ - name: Install dependencies
32
+ run: |
33
+ uv pip install --system -e ".[dev]"
34
+
35
+ - name: Lint with ruff (non-blocking)
36
+ continue-on-error: true
37
+ run: |
38
+ uv pip install --system ruff
39
+ ruff check praisonaiwp/ tests/ || true
40
+
41
+ - name: Run unit tests
42
+ run: |
43
+ pytest tests/ -v --ignore=tests/test_cli_integration.py --ignore=tests/ai/ --ignore=tests/cli/test_ai_commands.py --ignore=tests/test_e2e_ai.py
44
+
45
+ - name: Run integration tests
46
+ run: |
47
+ pytest tests/test_cli_integration.py -v
48
+
49
+ - name: Test CLI imports
50
+ run: |
51
+ python -c "from praisonaiwp.cli.main import cli; print('✅ CLI imports successful')"
52
+ python -c "from praisonaiwp.cli.commands.create import create_command; print('✅ Create command imports successful')"
53
+ python -c "from praisonaiwp.cli.commands.update import update_command; print('✅ Update command imports successful')"
54
+
55
+ - name: Test CLI help commands
56
+ run: |
57
+ python -m praisonaiwp.cli.main --help
58
+ python -m praisonaiwp.cli.main create --help
59
+ python -m praisonaiwp.cli.main update --help
60
+ python -m praisonaiwp.cli.main list --help
61
+ python -m praisonaiwp.cli.main find --help
62
+
63
+ - name: Test package version
64
+ run: |
65
+ python -c "from praisonaiwp.__version__ import __version__; print(f'Version: {__version__}')"
66
+
67
+ - name: Build package
68
+ run: |
69
+ uv build
70
+
71
+ - name: Test package installation
72
+ run: |
73
+ pip install dist/*.whl
74
+ python -c "import praisonaiwp; print('✅ Package installed successfully')"
75
+ python -m praisonaiwp.cli.main --help
76
+
77
+ - name: Upload coverage
78
+ if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
79
+ uses: codecov/codecov-action@v4
80
+ with:
81
+ file: ./coverage.xml
82
+ fail_ci_if_error: false
83
+
84
+ test-windows:
85
+ runs-on: windows-latest
86
+ strategy:
87
+ matrix:
88
+ python-version: ['3.8', '3.12']
89
+
90
+ steps:
91
+ - uses: actions/checkout@v4
92
+
93
+ - name: Set up Python ${{ matrix.python-version }}
94
+ uses: actions/setup-python@v5
95
+ with:
96
+ python-version: ${{ matrix.python-version }}
97
+
98
+ - name: Install dependencies
99
+ run: |
100
+ pip install -e ".[dev]"
101
+
102
+ - name: Run tests
103
+ run: |
104
+ pytest tests/ -v --ignore=tests/ai/ --ignore=tests/cli/test_ai_commands.py --ignore=tests/test_e2e_ai.py
105
+
106
+ - name: Test CLI imports
107
+ run: |
108
+ python -c "from praisonaiwp.cli.main import cli"
109
+
110
+ integration-check:
111
+ runs-on: ubuntu-latest
112
+ needs: [test, test-windows]
113
+
114
+ steps:
115
+ - uses: actions/checkout@v4
116
+
117
+ - name: Set up Python
118
+ uses: actions/setup-python@v5
119
+ with:
120
+ python-version: '3.12'
121
+
122
+ - name: Install package
123
+ run: |
124
+ pip install -e .
125
+
126
+ - name: Critical import regression tests
127
+ run: |
128
+ # Test that v1.0.17 bug doesn't happen again
129
+ python -c "from praisonaiwp.editors.content_editor import ContentEditor; print('✅ ContentEditor in correct location')"
130
+ python -c "from praisonaiwp.utils.block_converter import convert_to_blocks; print('✅ Block converter accessible')"
131
+
132
+ # Test that wrong imports fail
133
+ python -c "
134
+ try:
135
+ from praisonaiwp.core.content_editor import ContentEditor
136
+ print('❌ FAIL: ContentEditor should NOT be in core/')
137
+ exit(1)
138
+ except ModuleNotFoundError:
139
+ print('✅ PASS: ContentEditor correctly not in core/')
140
+ "
141
+
142
+ - name: Test all CLI commands work
143
+ run: |
144
+ python -m praisonaiwp.cli.main --help
145
+ python -m praisonaiwp.cli.main create --help | grep -q "convert-to-blocks"
146
+ python -m praisonaiwp.cli.main update --help | grep -q "convert-to-blocks"
147
+ echo "✅ All CLI commands working"
148
+
149
+ - name: Summary
150
+ run: |
151
+ echo "✅ All integration checks passed"
152
+ echo "✅ No import errors detected"
153
+ echo "✅ CLI commands functional"
154
+ echo "✅ New features accessible"
@@ -0,0 +1,59 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual Environment
24
+ venv/
25
+ ENV/
26
+ env/
27
+ .venv/
28
+
29
+ # uv
30
+ uv.lock
31
+
32
+ # IDE
33
+ .vscode/
34
+ .idea/
35
+ *.swp
36
+ *.swo
37
+ *~
38
+
39
+ # Testing
40
+ .pytest_cache/
41
+ .coverage
42
+ htmlcov/
43
+ .tox/
44
+
45
+ # Config
46
+ .env
47
+ config.yaml
48
+ servers.yaml
49
+
50
+ # Logs
51
+ *.log
52
+ logs/
53
+
54
+ # Backups
55
+ backups/
56
+
57
+ # OS
58
+ .DS_Store
59
+ Thumbs.db
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,65 @@
1
+ # AI Features Documentation
2
+
3
+ ## 📚 Main Documentation
4
+
5
+ **All AI features are now documented in one comprehensive guide:**
6
+
7
+ 👉 **[PRAISONAI.md](./PRAISONAI.md)** - Complete PraisonAI Integration Guide
8
+
9
+ This single document contains everything you need:
10
+ - Quick Start
11
+ - Installation
12
+ - Features Overview
13
+ - Architecture
14
+ - Usage Examples
15
+ - Configuration
16
+ - Production Features
17
+ - API Reference
18
+ - Cost & Performance
19
+ - Testing
20
+ - Troubleshooting
21
+ - Advanced Topics
22
+
23
+ ## 🚀 Quick Links
24
+
25
+ ### Getting Started
26
+ - [Quick Start](./PRAISONAI.md#quick-start)
27
+ - [Installation](./PRAISONAI.md#installation)
28
+ - [Basic Usage](./PRAISONAI.md#usage-examples)
29
+
30
+ ### Reference
31
+ - [API Reference](./PRAISONAI.md#api-reference)
32
+ - [Configuration](./PRAISONAI.md#configuration)
33
+ - [Troubleshooting](./PRAISONAI.md#troubleshooting)
34
+
35
+ ### Advanced
36
+ - [Architecture](./PRAISONAI.md#architecture)
37
+ - [Production Features](./PRAISONAI.md#production-features)
38
+ - [Advanced Topics](./PRAISONAI.md#advanced-topics)
39
+
40
+ ## 📋 Other Documentation
41
+
42
+ - **[CHANGELOG.md](./CHANGELOG.md)** - Version history and changes
43
+ - **[RELEASE_NOTES_v1.1.0.md](./RELEASE_NOTES_v1.1.0.md)** - Current release notes
44
+ - **[RELEASE_CHECKLIST.md](./RELEASE_CHECKLIST.md)** - Release process guide
45
+
46
+ ## 💡 Quick Start
47
+
48
+ ```bash
49
+ # Install with AI features
50
+ pip install praisonaiwp[ai]
51
+
52
+ # Set API key
53
+ export OPENAI_API_KEY="sk-..."
54
+
55
+ # Generate content
56
+ praisonaiwp ai generate "AI Trends 2025"
57
+
58
+ # Generate and publish
59
+ praisonaiwp ai generate "AI Trends" \
60
+ --title "The Future of AI" \
61
+ --auto-publish \
62
+ --status publish
63
+ ```
64
+
65
+ For complete documentation, see **[PRAISONAI.md](./PRAISONAI.md)**