orca-platform-sdk-ui 1.0.8__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 (96) hide show
  1. orca_platform_sdk_ui-1.0.8/CHANGELOG.md +96 -0
  2. orca_platform_sdk_ui-1.0.8/CONTRIBUTING.md +278 -0
  3. orca_platform_sdk_ui-1.0.8/LICENSE +21 -0
  4. orca_platform_sdk_ui-1.0.8/MANIFEST.in +26 -0
  5. orca_platform_sdk_ui-1.0.8/PKG-INFO +318 -0
  6. orca_platform_sdk_ui-1.0.8/README.md +271 -0
  7. orca_platform_sdk_ui-1.0.8/SECURITY.md +326 -0
  8. orca_platform_sdk_ui-1.0.8/docs/README.md +56 -0
  9. orca_platform_sdk_ui-1.0.8/docs/guides/API_REFERENCE.md +635 -0
  10. orca_platform_sdk_ui-1.0.8/docs/guides/DEVELOPER_GUIDE.md +2696 -0
  11. orca_platform_sdk_ui-1.0.8/docs/guides/DEV_MODE_GUIDE.md +304 -0
  12. orca_platform_sdk_ui-1.0.8/docs/guides/LAMBDA_DEPLOY_GUIDE.md +371 -0
  13. orca_platform_sdk_ui-1.0.8/docs/guides/PATTERNS_GUIDE.md +660 -0
  14. orca_platform_sdk_ui-1.0.8/docs/guides/QUICK_REFERENCE.md +546 -0
  15. orca_platform_sdk_ui-1.0.8/docs/guides/STORAGE_SDK_GUIDE.md +362 -0
  16. orca_platform_sdk_ui-1.0.8/docs/guides/UTILITIES_GUIDE.md +696 -0
  17. orca_platform_sdk_ui-1.0.8/examples/README.md +133 -0
  18. orca_platform_sdk_ui-1.0.8/orca/__init__.py +192 -0
  19. orca_platform_sdk_ui-1.0.8/orca/adapters/__init__.py +14 -0
  20. orca_platform_sdk_ui-1.0.8/orca/adapters/lambda_adapter.py +291 -0
  21. orca_platform_sdk_ui-1.0.8/orca/common/__init__.py +123 -0
  22. orca_platform_sdk_ui-1.0.8/orca/common/decorators.py +338 -0
  23. orca_platform_sdk_ui-1.0.8/orca/common/exceptions.py +336 -0
  24. orca_platform_sdk_ui-1.0.8/orca/common/logging_config.py +238 -0
  25. orca_platform_sdk_ui-1.0.8/orca/common/type_guards.py +318 -0
  26. orca_platform_sdk_ui-1.0.8/orca/config.py +293 -0
  27. orca_platform_sdk_ui-1.0.8/orca/core/__init__.py +13 -0
  28. orca_platform_sdk_ui-1.0.8/orca/core/handler.py +207 -0
  29. orca_platform_sdk_ui-1.0.8/orca/core/session/__init__.py +22 -0
  30. orca_platform_sdk_ui-1.0.8/orca/core/session/audio_ops.py +81 -0
  31. orca_platform_sdk_ui-1.0.8/orca/core/session/button_ops.py +125 -0
  32. orca_platform_sdk_ui-1.0.8/orca/core/session/card_ops.py +67 -0
  33. orca_platform_sdk_ui-1.0.8/orca/core/session/core.py +202 -0
  34. orca_platform_sdk_ui-1.0.8/orca/core/session/escalation_ops.py +103 -0
  35. orca_platform_sdk_ui-1.0.8/orca/core/session/image_ops.py +47 -0
  36. orca_platform_sdk_ui-1.0.8/orca/core/session/loading_ops.py +54 -0
  37. orca_platform_sdk_ui-1.0.8/orca/core/session/location_ops.py +55 -0
  38. orca_platform_sdk_ui-1.0.8/orca/core/session/tracing_ops.py +78 -0
  39. orca_platform_sdk_ui-1.0.8/orca/core/session/usage_ops.py +91 -0
  40. orca_platform_sdk_ui-1.0.8/orca/core/session/video_ops.py +58 -0
  41. orca_platform_sdk_ui-1.0.8/orca/domain/__init__.py +39 -0
  42. orca_platform_sdk_ui-1.0.8/orca/domain/interfaces.py +197 -0
  43. orca_platform_sdk_ui-1.0.8/orca/domain/models.py +69 -0
  44. orca_platform_sdk_ui-1.0.8/orca/factories/__init__.py +11 -0
  45. orca_platform_sdk_ui-1.0.8/orca/factories/stream_client_factory.py +151 -0
  46. orca_platform_sdk_ui-1.0.8/orca/helpers/__init__.py +13 -0
  47. orca_platform_sdk_ui-1.0.8/orca/helpers/button_helper.py +115 -0
  48. orca_platform_sdk_ui-1.0.8/orca/helpers/button_utils.py +46 -0
  49. orca_platform_sdk_ui-1.0.8/orca/infrastructure/__init__.py +14 -0
  50. orca_platform_sdk_ui-1.0.8/orca/infrastructure/api_client.py +153 -0
  51. orca_platform_sdk_ui-1.0.8/orca/infrastructure/centrifugo_client.py +134 -0
  52. orca_platform_sdk_ui-1.0.8/orca/infrastructure/dev_stream_client.py +244 -0
  53. orca_platform_sdk_ui-1.0.8/orca/patterns/__init__.py +46 -0
  54. orca_platform_sdk_ui-1.0.8/orca/patterns/builder.py +744 -0
  55. orca_platform_sdk_ui-1.0.8/orca/patterns/context.py +203 -0
  56. orca_platform_sdk_ui-1.0.8/orca/patterns/middleware.py +303 -0
  57. orca_platform_sdk_ui-1.0.8/orca/requirements.txt +14 -0
  58. orca_platform_sdk_ui-1.0.8/orca/services/__init__.py +27 -0
  59. orca_platform_sdk_ui-1.0.8/orca/services/buffer_manager.py +111 -0
  60. orca_platform_sdk_ui-1.0.8/orca/services/button_renderer.py +222 -0
  61. orca_platform_sdk_ui-1.0.8/orca/services/error_handler.py +188 -0
  62. orca_platform_sdk_ui-1.0.8/orca/services/escalation_service.py +152 -0
  63. orca_platform_sdk_ui-1.0.8/orca/services/loading_marker_provider.py +153 -0
  64. orca_platform_sdk_ui-1.0.8/orca/services/response_builder.py +214 -0
  65. orca_platform_sdk_ui-1.0.8/orca/services/tracing_service.py +197 -0
  66. orca_platform_sdk_ui-1.0.8/orca/services/usage_tracker.py +175 -0
  67. orca_platform_sdk_ui-1.0.8/orca/storage/README.md +32 -0
  68. orca_platform_sdk_ui-1.0.8/orca/storage/__init__.py +41 -0
  69. orca_platform_sdk_ui-1.0.8/orca/storage/base_client.py +150 -0
  70. orca_platform_sdk_ui-1.0.8/orca/storage/bucket_service.py +97 -0
  71. orca_platform_sdk_ui-1.0.8/orca/storage/client.py +218 -0
  72. orca_platform_sdk_ui-1.0.8/orca/storage/file_service.py +210 -0
  73. orca_platform_sdk_ui-1.0.8/orca/storage/permission_service.py +99 -0
  74. orca_platform_sdk_ui-1.0.8/orca/utils/__init__.py +59 -0
  75. orca_platform_sdk_ui-1.0.8/orca/utils/app_utils.py +69 -0
  76. orca_platform_sdk_ui-1.0.8/orca/utils/environment.py +50 -0
  77. orca_platform_sdk_ui-1.0.8/orca/utils/files.py +77 -0
  78. orca_platform_sdk_ui-1.0.8/orca/utils/lambda_utils.py +193 -0
  79. orca_platform_sdk_ui-1.0.8/orca/utils/memory.py +127 -0
  80. orca_platform_sdk_ui-1.0.8/orca/utils/prompts.py +66 -0
  81. orca_platform_sdk_ui-1.0.8/orca/utils/response_handler.py +46 -0
  82. orca_platform_sdk_ui-1.0.8/orca/utils/tools.py +76 -0
  83. orca_platform_sdk_ui-1.0.8/orca/utils/variables.py +141 -0
  84. orca_platform_sdk_ui-1.0.8/orca/web/__init__.py +15 -0
  85. orca_platform_sdk_ui-1.0.8/orca/web/app_factory.py +70 -0
  86. orca_platform_sdk_ui-1.0.8/orca/web/endpoints.py +525 -0
  87. orca_platform_sdk_ui-1.0.8/orca_platform_sdk_ui.egg-info/PKG-INFO +318 -0
  88. orca_platform_sdk_ui-1.0.8/orca_platform_sdk_ui.egg-info/SOURCES.txt +94 -0
  89. orca_platform_sdk_ui-1.0.8/orca_platform_sdk_ui.egg-info/dependency_links.txt +1 -0
  90. orca_platform_sdk_ui-1.0.8/orca_platform_sdk_ui.egg-info/requires.txt +13 -0
  91. orca_platform_sdk_ui-1.0.8/orca_platform_sdk_ui.egg-info/top_level.txt +1 -0
  92. orca_platform_sdk_ui-1.0.8/pyproject.toml +65 -0
  93. orca_platform_sdk_ui-1.0.8/setup.cfg +4 -0
  94. orca_platform_sdk_ui-1.0.8/setup.py +82 -0
  95. orca_platform_sdk_ui-1.0.8/tests/test_package.py +172 -0
  96. orca_platform_sdk_ui-1.0.8/tests/test_refactored.py +270 -0
@@ -0,0 +1,96 @@
1
+ # Changelog
2
+
3
+ All notable changes to Orca SDK will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Planned
11
+
12
+ - Enhanced caching mechanisms
13
+ - Additional storage backends
14
+ - Improved middleware system
15
+ - More deployment adapters (Cloud Run, ECS, etc.)
16
+
17
+ ## [1.0.4] - 2025-12-29
18
+
19
+ ### Added
20
+
21
+ - **Lambda Adapter**: Complete AWS Lambda deployment support
22
+ - Automatic HTTP, SQS, and Cron event handling
23
+ - Event loop management for Python 3.11+
24
+ - Automatic SQS queuing when `SQS_QUEUE_URL` exists
25
+ - Production-ready templates and examples
26
+ - **Storage SDK**: Integrated file storage management
27
+ - `OrcaStorage` client for unified storage operations
28
+ - Support for bucket management, file operations, and permissions
29
+ - **Design Patterns**: Professional pattern implementations
30
+ - `OrcaBuilder` and `SessionBuilder` for fluent interfaces
31
+ - Context managers for resource management
32
+ - Middleware system with chain of responsibility
33
+ - **Documentation**: Comprehensive guides for Lambda, Storage, and API
34
+
35
+ ### Changed
36
+
37
+ - **Architecture**: Core refactoring to SOLID principles
38
+ - **Session Management**: Improved composition and cleaner API surface
39
+ - **Error Handling**: Enhanced custom exception hierarchy
40
+
41
+ ### Improved
42
+
43
+ - **Type Safety**: 100% type hint coverage
44
+ - **Logging**: Professional logging configuration with rotation
45
+
46
+ ## [1.0.0] - 2024-XX-XX
47
+
48
+ ### Added
49
+
50
+ - Initial release
51
+ - Basic streaming functionality
52
+ - Real-time communication with Centrifugo
53
+ - Button rendering, loading indicators, and usage tracking
54
+
55
+ ---
56
+
57
+ ## Upgrade Guide
58
+
59
+ ### Migrating to 1.0.4
60
+
61
+ #### Import Changes
62
+
63
+ ```python
64
+ # Old
65
+ from orca.unified_handler import OrcaHandler
66
+
67
+ # New
68
+ from orca import OrcaHandler
69
+ ```
70
+
71
+ #### Session API Improvements
72
+
73
+ The API has been moved to a more organized structure:
74
+
75
+ ```python
76
+ # Old
77
+ session.start_loading("thinking")
78
+ session.button_link("Click", "https://example.com")
79
+
80
+ # New
81
+ session.loading.start("thinking")
82
+ session.button.link("Click", "https://example.com")
83
+ ```
84
+
85
+ #### Backward Compatibility
86
+
87
+ The old flat session API still works but is deprecated and will be removed in future versions.
88
+
89
+ ---
90
+
91
+ ## Support
92
+
93
+ For questions or issues:
94
+
95
+ - Email: [support@orcaolatform.ai](mailto:support@orcaolatform.ai)
96
+ - GitHub: [orcapt/orca-pip](https://github.com/orcapt/orca-pip/issues)
@@ -0,0 +1,278 @@
1
+ # Contributing to Orca SDK
2
+
3
+ Thank you for your interest in contributing to Orca SDK! This document provides guidelines and instructions for contributing.
4
+
5
+ ## Code of Conduct
6
+
7
+ By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
8
+
9
+ ## Getting Started
10
+
11
+ ### Prerequisites
12
+
13
+ - Python 3.8 or higher
14
+ - Git
15
+ - pip
16
+
17
+ ### Setting Up Development Environment
18
+
19
+ ```bash
20
+ # Clone the repository
21
+ git clone https://github.com/orcapt/orca-pip
22
+ cd orca-pip
23
+
24
+ # Create virtual environment
25
+ python -m venv venv
26
+ source venv/bin/activate # On Windows: venv\Scripts\activate
27
+
28
+ # Install dependencies
29
+ pip install -r requirements.txt
30
+
31
+ # Install development dependencies
32
+ pip install pytest pytest-cov black mypy flake8
33
+ ```
34
+
35
+ ## Development Workflow
36
+
37
+ ### 1. Create a Branch
38
+
39
+ ```bash
40
+ git checkout -b feature/your-feature-name
41
+ ```
42
+
43
+ Use prefixes:
44
+
45
+ - `feature/` for new features
46
+ - `fix/` for bug fixes
47
+ - `docs/` for documentation
48
+ - `refactor/` for code refactoring
49
+ - `test/` for test improvements
50
+
51
+ ### 2. Make Changes
52
+
53
+ - Write clean, readable code
54
+ - Follow PEP 8 style guide
55
+ - Add docstrings to functions and classes
56
+ - Update tests for your changes
57
+ - Update documentation if needed
58
+
59
+ ### 3. Run Tests
60
+
61
+ ```bash
62
+ # Run all tests
63
+ pytest
64
+
65
+ # Run with coverage
66
+ pytest --cov=orca --cov-report=html
67
+
68
+ # Run specific test file
69
+ pytest tests/test_handler.py
70
+
71
+ # Run with verbose output
72
+ pytest -v
73
+ ```
74
+
75
+ ### 4. Code Quality Checks
76
+
77
+ ```bash
78
+ # Format code with black
79
+ black orca/ tests/ examples/
80
+
81
+ # Type checking with mypy
82
+ mypy orca/
83
+
84
+ # Linting with flake8
85
+ flake8 orca/ tests/ examples/
86
+ ```
87
+
88
+ ### 5. Commit Your Changes
89
+
90
+ ```bash
91
+ git add .
92
+ git commit -m "feat: add new feature"
93
+ ```
94
+
95
+ Use conventional commit messages:
96
+
97
+ - `feat:` for new features
98
+ - `fix:` for bug fixes
99
+ - `docs:` for documentation
100
+ - `refactor:` for code refactoring
101
+ - `test:` for tests
102
+ - `chore:` for maintenance
103
+
104
+ ### 6. Push and Create Pull Request
105
+
106
+ ```bash
107
+ git push origin feature/your-feature-name
108
+ ```
109
+
110
+ Then create a pull request on GitHub.
111
+
112
+ ## Code Guidelines
113
+
114
+ ### Python Style
115
+
116
+ - Follow PEP 8
117
+ - Use type hints
118
+ - Maximum line length: 100 characters
119
+ - Use meaningful variable names
120
+ - Add docstrings to all public functions/classes
121
+
122
+ Example:
123
+
124
+ ```python
125
+ from typing import Optional, Dict, Any
126
+
127
+ def process_data(
128
+ data: Dict[str, Any],
129
+ options: Optional[Dict[str, Any]] = None
130
+ ) -> str:
131
+ """
132
+ Process data with optional configuration.
133
+
134
+ Args:
135
+ data: Input data dictionary
136
+ options: Optional configuration parameters
137
+
138
+ Returns:
139
+ Processed result as string
140
+
141
+ Raises:
142
+ ValueError: If data is invalid
143
+ """
144
+ if not data:
145
+ raise ValueError("Data cannot be empty")
146
+
147
+ # Processing logic
148
+ return str(data)
149
+ ```
150
+
151
+ ### Architecture
152
+
153
+ Orca SDK follows clean architecture principles:
154
+
155
+ 1. **Domain Layer** (`domain/`)
156
+
157
+ - Interfaces and models
158
+ - No dependencies on other layers
159
+
160
+ 2. **Services Layer** (`services/`)
161
+
162
+ - Business logic
163
+ - Depends only on domain
164
+
165
+ 3. **Infrastructure Layer** (`infrastructure/`)
166
+
167
+ - External clients (API, Centrifugo, etc.)
168
+ - Implements domain interfaces
169
+
170
+ 4. **Core Layer** (`core/`)
171
+ - Main handler and session orchestration
172
+ - Uses services and infrastructure
173
+
174
+ When adding new features:
175
+
176
+ - Define interfaces in `domain/`
177
+ - Implement business logic in `services/`
178
+ - Add external integrations in `infrastructure/`
179
+ - Wire everything in `core/`
180
+
181
+ ### Testing
182
+
183
+ - Write unit tests for all new code
184
+ - Aim for >80% code coverage
185
+ - Use mocking for external dependencies
186
+ - Test edge cases and error conditions
187
+
188
+ Example test:
189
+
190
+ ```python
191
+ import pytest
192
+ from orca import OrcaHandler
193
+
194
+ def test_handler_initialization():
195
+ """Test that handler initializes correctly."""
196
+ handler = OrcaHandler(dev_mode=True)
197
+ assert handler.dev_mode is True
198
+
199
+ def test_handler_begin_session():
200
+ """Test session creation."""
201
+ handler = OrcaHandler(dev_mode=True)
202
+ # Test logic here
203
+ pass
204
+
205
+ def test_error_handling():
206
+ """Test error handling."""
207
+ handler = OrcaHandler(dev_mode=True)
208
+ with pytest.raises(ValueError):
209
+ # Code that should raise error
210
+ pass
211
+ ```
212
+
213
+ ### Documentation
214
+
215
+ - Update README.md for user-facing changes
216
+ - Add docstrings to all public APIs
217
+ - Update guides in `docs/` for major features
218
+ - Add examples to `examples/` directory
219
+
220
+ ## Pull Request Process
221
+
222
+ 1. **Ensure Tests Pass**: All tests must pass
223
+ 2. **Update Documentation**: Update relevant docs
224
+ 3. **Add Examples**: Add examples if adding new features
225
+ 4. **Code Review**: Wait for maintainer review
226
+ 5. **Address Feedback**: Make requested changes
227
+ 6. **Squash Commits**: Keep PR history clean
228
+
229
+ ## Pull Request Template
230
+
231
+ ```markdown
232
+ ## Description
233
+
234
+ Brief description of changes
235
+
236
+ ## Type of Change
237
+
238
+ - [ ] Bug fix
239
+ - [ ] New feature
240
+ - [ ] Breaking change
241
+ - [ ] Documentation update
242
+
243
+ ## Testing
244
+
245
+ - [ ] Unit tests added/updated
246
+ - [ ] Integration tests added/updated
247
+ - [ ] All tests pass
248
+
249
+ ## Checklist
250
+
251
+ - [ ] Code follows style guidelines
252
+ - [ ] Self-review completed
253
+ - [ ] Documentation updated
254
+ - [ ] No new warnings
255
+ - [ ] Tests added
256
+ ```
257
+
258
+ ## Release Process
259
+
260
+ Releases are handled by maintainers:
261
+
262
+ 1. Update version in `setup.py`
263
+ 2. Update `CHANGELOG.md`
264
+ 3. Create git tag
265
+ 4. Build and publish to PyPI
266
+ 5. Create GitHub release
267
+
268
+ ## Questions?
269
+
270
+ - Open an issue for bugs or feature requests
271
+ - Join our Discord for discussions
272
+ - Email support@orcaolatform.ai for other questions
273
+
274
+ ## License
275
+
276
+ By contributing, you agree that your contributions will be licensed under the MIT License.
277
+
278
+ Thank you for contributing to Orca SDK! 🚀
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Orca Platform Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,26 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include CONTRIBUTING.md
5
+ include SECURITY.md
6
+ include orca/requirements.txt
7
+ include orca/*.md
8
+ include orca/*.txt
9
+ recursive-include orca *.py
10
+ recursive-include orca *
11
+ # Include documentation files
12
+ recursive-include docs *.md
13
+ recursive-include examples *.md
14
+ recursive-exclude * __pycache__
15
+ recursive-exclude * *.py[co]
16
+ recursive-exclude * .DS_Store
17
+ recursive-exclude * .git*
18
+ recursive-exclude * .vscode*
19
+ recursive-exclude * .idea*
20
+ recursive-exclude * orca_env*
21
+ recursive-exclude * .pytest_cache*
22
+ recursive-exclude * *.egg-info*
23
+ recursive-exclude * dist*
24
+ recursive-exclude build *
25
+ recursive-exclude * build/
26
+