sumospace 0.1.0__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 (67) hide show
  1. sumospace-0.1.0/.gitignore +74 -0
  2. sumospace-0.1.0/CHANGELOG.md +31 -0
  3. sumospace-0.1.0/CONTRIBUTING.md +40 -0
  4. sumospace-0.1.0/LICENSE +21 -0
  5. sumospace-0.1.0/PKG-INFO +525 -0
  6. sumospace-0.1.0/README.md +426 -0
  7. sumospace-0.1.0/examples/01_quickstart.py +35 -0
  8. sumospace-0.1.0/examples/02_custom_hooks.py +52 -0
  9. sumospace-0.1.0/examples/03_advanced_telemetry.py +36 -0
  10. sumospace-0.1.0/examples/04_multi_user_server.py +60 -0
  11. sumospace-0.1.0/examples/code_refactor.py +83 -0
  12. sumospace-0.1.0/examples/desktop_agent/README.md +73 -0
  13. sumospace-0.1.0/examples/desktop_agent/__init__.py +1 -0
  14. sumospace-0.1.0/examples/desktop_agent/agent.py +648 -0
  15. sumospace-0.1.0/examples/desktop_agent/app.py +461 -0
  16. sumospace-0.1.0/examples/desktop_agent/desktop_tools.py +466 -0
  17. sumospace-0.1.0/examples/image_search_app.py +123 -0
  18. sumospace-0.1.0/examples/repo_manager.py +49 -0
  19. sumospace-0.1.0/pyproject.toml +147 -0
  20. sumospace-0.1.0/sumospace/__init__.py +30 -0
  21. sumospace-0.1.0/sumospace/audit.py +272 -0
  22. sumospace-0.1.0/sumospace/cache.py +85 -0
  23. sumospace-0.1.0/sumospace/classifier.py +410 -0
  24. sumospace-0.1.0/sumospace/cli.py +548 -0
  25. sumospace-0.1.0/sumospace/committee.py +444 -0
  26. sumospace-0.1.0/sumospace/config.py +50 -0
  27. sumospace-0.1.0/sumospace/exceptions.py +52 -0
  28. sumospace-0.1.0/sumospace/hooks.py +133 -0
  29. sumospace-0.1.0/sumospace/ingest.py +772 -0
  30. sumospace-0.1.0/sumospace/kernel.py +1004 -0
  31. sumospace-0.1.0/sumospace/memory.py +267 -0
  32. sumospace-0.1.0/sumospace/multimodal/__init__.py +23 -0
  33. sumospace-0.1.0/sumospace/multimodal/audio.py +195 -0
  34. sumospace-0.1.0/sumospace/multimodal/video.py +238 -0
  35. sumospace-0.1.0/sumospace/providers.py +696 -0
  36. sumospace-0.1.0/sumospace/py.typed +0 -0
  37. sumospace-0.1.0/sumospace/rag.py +204 -0
  38. sumospace-0.1.0/sumospace/scope.py +299 -0
  39. sumospace-0.1.0/sumospace/settings.py +231 -0
  40. sumospace-0.1.0/sumospace/telemetry.py +110 -0
  41. sumospace-0.1.0/sumospace/templates.py +203 -0
  42. sumospace-0.1.0/sumospace/tools.py +639 -0
  43. sumospace-0.1.0/sumospace/utils/tokens.py +26 -0
  44. sumospace-0.1.0/tests/__init__.py +0 -0
  45. sumospace-0.1.0/tests/conftest.py +62 -0
  46. sumospace-0.1.0/tests/test_audit.py +82 -0
  47. sumospace-0.1.0/tests/test_cache.py +67 -0
  48. sumospace-0.1.0/tests/test_classifier.py +131 -0
  49. sumospace-0.1.0/tests/test_committee.py +210 -0
  50. sumospace-0.1.0/tests/test_committee_toggle.py +142 -0
  51. sumospace-0.1.0/tests/test_concurrency.py +138 -0
  52. sumospace-0.1.0/tests/test_error_recovery.py +64 -0
  53. sumospace-0.1.0/tests/test_hooks.py +144 -0
  54. sumospace-0.1.0/tests/test_hooks_integration.py +64 -0
  55. sumospace-0.1.0/tests/test_ingest.py +310 -0
  56. sumospace-0.1.0/tests/test_kernel.py +243 -0
  57. sumospace-0.1.0/tests/test_memory.py +175 -0
  58. sumospace-0.1.0/tests/test_plugin_tools.py +83 -0
  59. sumospace-0.1.0/tests/test_presets.py +63 -0
  60. sumospace-0.1.0/tests/test_providers.py +146 -0
  61. sumospace-0.1.0/tests/test_rag.py +186 -0
  62. sumospace-0.1.0/tests/test_scope.py +464 -0
  63. sumospace-0.1.0/tests/test_settings.py +19 -0
  64. sumospace-0.1.0/tests/test_telemetry.py +50 -0
  65. sumospace-0.1.0/tests/test_templates.py +98 -0
  66. sumospace-0.1.0/tests/test_tools.py +256 -0
  67. sumospace-0.1.0/tests/test_truncation.py +57 -0
@@ -0,0 +1,74 @@
1
+ # Build
2
+ dist/
3
+ build/
4
+ *.egg-info/
5
+ .eggs/
6
+ pyproject.toml.bak
7
+
8
+ # SumoSpace runtime
9
+ .sumo_db/
10
+ .sumo_audit/
11
+ .sumo_desktop_db/
12
+ .sumo_image_db/
13
+ .sumo_finance_db/
14
+ .sumo_cache/
15
+ .sumo_secrets/
16
+ examples/sumofinance
17
+ *.jsonl
18
+ *.log
19
+
20
+ # Python
21
+ __pycache__/
22
+ *.py[cod]
23
+ *$py.class
24
+ *.so
25
+ .Python
26
+ develop-eggs/
27
+ downloads/
28
+ eggs/
29
+ lib/
30
+ lib64/
31
+ parts/
32
+ sdist/
33
+ var/
34
+ wheels/
35
+ share/python-wheels/
36
+ .installed.cfg
37
+ *.egg
38
+ MANIFEST
39
+
40
+ # Virtual Environments
41
+ .venv/
42
+ venv/
43
+ ENV/
44
+ env/
45
+
46
+ # Environment
47
+ .env
48
+ .env.*
49
+ !.env.example
50
+
51
+ # IDE
52
+ .vscode/
53
+ .idea/
54
+ *.swp
55
+ *.swo
56
+ .project
57
+ .pydevproject
58
+ .settings/
59
+
60
+ # Coverage / Testing
61
+ .coverage
62
+ htmlcov/
63
+ coverage.xml
64
+ .pytest_cache/
65
+ .tox/
66
+ .nox/
67
+ nosetests.xml
68
+ coverage.xml
69
+ *.cover
70
+ .stack-work/
71
+
72
+ # OS
73
+ .DS_Store
74
+ Thumbs.db
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project 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
+ ## [0.5.0] - 2026-05-02
9
+
10
+ ### Added
11
+ - **Real-Time Streaming**: Added `kernel.stream_run()` to yield execution progress step-by-step, ideal for rendering UI updates without blocking until the end of the task.
12
+ - **Execution Plan Caching**: Repeated tasks with identical contexts now bypass the committee deliberation phase, resulting in near-instant execution starts and significantly lower token usage.
13
+ - **Multi-User Isolation**: Added `ScopeManager` to strictly isolate RAG context, audit logs, and memory between users (`user_id`), sessions (`session_id`), or projects (`project_id`).
14
+ - **Telemetry Support**: Full OpenTelemetry (OTLP) tracing added for latency profiling. Enable via `SUMO_TELEMETRY_ENABLED=true`.
15
+ - **Intelligent Context Truncation**: When codebase size exceeds token limits, the kernel now predictably sacrifices raw RAG results before discarding your core task instructions or recent memory.
16
+
17
+ ### Fixed
18
+ - **Provider Reliability**: If your primary LLM provider (e.g. OpenAI) times out or hits rate limits (429/503), the kernel now gracefully falls back to a pre-initialized secondary provider (e.g. local HuggingFace) mid-run.
19
+ - **Malformed Plan Recovery**: Local models occasionally output invalid JSON. The Committee now uses a 3-attempt retry loop with dynamic temperature bumping to self-correct formatting errors.
20
+ - **Concurrency Deadlocks**: Fixed race conditions and file lock contention in `AuditLogger` and `MemoryManager` when running multiple concurrent kernels.
21
+ - **Token Estimation Accuracy**: Fixed token estimation logic to prevent unexpected context window overflow crashes during large retrievals.
22
+ - **Memory Leaks**: Proper cleanup of resources during `kernel.shutdown()`.
23
+
24
+ ### Changed
25
+ - The `kernel.run()` method signature was updated to guarantee the return of a standard `ExecutionTrace`, safely capturing critical errors (`ConsensusFailedError`, `ExecutionHaltedError`) rather than throwing raw exceptions to your application.
26
+ - Renamed CLI audit subcommands and their `AuditLogger` counterparts for exact 1:1 mapping (e.g., `sumo logs list` now calls `audit.list()`).
27
+ - Deprecated `KernelConfig` in favor of the unified `SumoSettings`.
28
+
29
+ ### Security
30
+ - Added robust path traversal safeguards to `ScopeManager` to prevent cross-tenant data leaks.
31
+ - Added dependency isolation to `UniversalIngestor` to prevent arbitrary code execution during codebase parsing.
@@ -0,0 +1,40 @@
1
+ # Contributing to SumoSpace
2
+
3
+ Thank you for investing your time in contributing to our project!
4
+
5
+ ## Architecture Overview
6
+ SumoSpace is built around an autonomous, deliberative agent architecture:
7
+ - **Classifier**: Determines if a task requires web search or codebase RAG.
8
+ - **Committee**: A 3-agent group (Planner, Critic, Resolver) that agrees on a safe execution plan before taking action.
9
+ - **Kernel**: The main orchestrator that manages lifecycles, memory, scopes, and tools.
10
+
11
+ ## Development Setup
12
+ 1. Clone the repository: `git clone https://github.com/omdeepb69/sumospace.git`
13
+ 2. Create a virtual environment: `python -m venv venv && source venv/bin/activate`
14
+ 3. Install dependencies: `pip install -e ".[dev]"`
15
+ 4. Run tests: `pytest`
16
+
17
+ ## Adding a New Provider
18
+
19
+ To add support for a new LLM provider (e.g. Cohere, Groq):
20
+ 1. Subclass `BaseProvider` in `sumospace/providers.py`.
21
+ 2. Implement `initialize()`, `complete()`, and `stream()`.
22
+ 3. Register your provider in the `PROVIDERS` dict at the top of `providers.py` with a string key (e.g., `"cohere"`).
23
+ 4. Add any required optional dependencies to `pyproject.toml` (e.g., `cohere = ["cohere>=5.0.0"]`).
24
+ 5. Add settings fields to `SumoSettings` in `sumospace/settings.py` using the `SUMO_` prefix (e.g., `SUMO_COHERE_API_KEY`).
25
+ 6. Add a test in `tests/test_providers.py` using the mock pattern from existing tests to verify your implementation without hitting real APIs.
26
+ 7. Document the addition in `CHANGELOG.md` under the `### Added` section.
27
+
28
+ ## Adding a New Tool
29
+
30
+ To give the agent new capabilities (e.g. interacting with Jira or AWS):
31
+ 1. Subclass `BaseTool` in `sumospace/tools.py`.
32
+ 2. Define the tool's `name`, `description`, `schema`, and `tags` as class attributes.
33
+ 3. Implement `async def run(self, **kwargs) -> ToolResult`. Ensure you gracefully catch errors and return `ToolResult(success=False, error=str(e))`.
34
+ 4. Register the tool in `ToolRegistry._register_defaults()` in `sumospace/tools.py`.
35
+ 5. Add a test in `tests/test_tools.py`.
36
+
37
+ ## Submitting Pull Requests
38
+ - Ensure all new features have accompanying unit/integration tests.
39
+ - Run `pytest` to verify nothing is broken.
40
+ - Provide a clear, descriptive PR title and summary.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Omdeep Borkar
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.