floorctl 0.3.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 (50) hide show
  1. floorctl-0.3.0/.gitignore +136 -0
  2. floorctl-0.3.0/LICENSE +21 -0
  3. floorctl-0.3.0/PKG-INFO +89 -0
  4. floorctl-0.3.0/README.md +53 -0
  5. floorctl-0.3.0/examples/architecture_adr.py +745 -0
  6. floorctl-0.3.0/examples/brainstorm.py +237 -0
  7. floorctl-0.3.0/examples/code_review.py +244 -0
  8. floorctl-0.3.0/examples/debate.py +340 -0
  9. floorctl-0.3.0/examples/distributed_debate.py +291 -0
  10. floorctl-0.3.0/examples/investment_committee.py +491 -0
  11. floorctl-0.3.0/pyproject.toml +50 -0
  12. floorctl-0.3.0/src/floorctl/__init__.py +187 -0
  13. floorctl-0.3.0/src/floorctl/agent.py +423 -0
  14. floorctl-0.3.0/src/floorctl/artifacts.py +454 -0
  15. floorctl-0.3.0/src/floorctl/backends/__init__.py +18 -0
  16. floorctl-0.3.0/src/floorctl/backends/base.py +91 -0
  17. floorctl-0.3.0/src/floorctl/backends/firestore.py +371 -0
  18. floorctl-0.3.0/src/floorctl/backends/memory.py +224 -0
  19. floorctl-0.3.0/src/floorctl/backends/websocket.py +361 -0
  20. floorctl-0.3.0/src/floorctl/config.py +159 -0
  21. floorctl-0.3.0/src/floorctl/consensus.py +496 -0
  22. floorctl-0.3.0/src/floorctl/conviction.py +514 -0
  23. floorctl-0.3.0/src/floorctl/floor.py +128 -0
  24. floorctl-0.3.0/src/floorctl/metrics.py +394 -0
  25. floorctl-0.3.0/src/floorctl/moderator.py +425 -0
  26. floorctl-0.3.0/src/floorctl/phases.py +69 -0
  27. floorctl-0.3.0/src/floorctl/py.typed +0 -0
  28. floorctl-0.3.0/src/floorctl/relay/__init__.py +5 -0
  29. floorctl-0.3.0/src/floorctl/relay/__main__.py +31 -0
  30. floorctl-0.3.0/src/floorctl/relay/server.py +392 -0
  31. floorctl-0.3.0/src/floorctl/session.py +196 -0
  32. floorctl-0.3.0/src/floorctl/state.py +113 -0
  33. floorctl-0.3.0/src/floorctl/transcript.py +373 -0
  34. floorctl-0.3.0/src/floorctl/types.py +150 -0
  35. floorctl-0.3.0/src/floorctl/urgency.py +253 -0
  36. floorctl-0.3.0/src/floorctl/validators.py +323 -0
  37. floorctl-0.3.0/tests/__init__.py +0 -0
  38. floorctl-0.3.0/tests/conftest.py +88 -0
  39. floorctl-0.3.0/tests/test_artifacts.py +246 -0
  40. floorctl-0.3.0/tests/test_consensus.py +298 -0
  41. floorctl-0.3.0/tests/test_conviction.py +291 -0
  42. floorctl-0.3.0/tests/test_floor.py +108 -0
  43. floorctl-0.3.0/tests/test_memory_backend.py +132 -0
  44. floorctl-0.3.0/tests/test_metrics.py +110 -0
  45. floorctl-0.3.0/tests/test_moderator.py +91 -0
  46. floorctl-0.3.0/tests/test_relay_server.py +452 -0
  47. floorctl-0.3.0/tests/test_state.py +94 -0
  48. floorctl-0.3.0/tests/test_urgency.py +125 -0
  49. floorctl-0.3.0/tests/test_validators.py +161 -0
  50. floorctl-0.3.0/tests/test_websocket_backend.py +207 -0
@@ -0,0 +1,136 @@
1
+ # =====================================================
2
+ # Environment and secrets
3
+ # =====================================================
4
+ .env
5
+ .env.*
6
+ .env.local
7
+ *.env
8
+ secrets/
9
+ *.pem
10
+ *.key
11
+
12
+ # =====================================================
13
+ # Logs
14
+ # =====================================================
15
+ *.log
16
+ audit.jsonl
17
+ logs/
18
+
19
+ # =====================================================
20
+ # Python
21
+ # =====================================================
22
+ __pycache__/
23
+ *.py[cod]
24
+ *$py.class
25
+ *.so
26
+ .Python
27
+ venv/
28
+ env/
29
+ ENV/
30
+ .venv/
31
+ .virtualenv/
32
+ *.egg-info/
33
+ dist/
34
+ build/
35
+ eggs/
36
+ *.egg
37
+ *.whl
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # =====================================================
42
+ # Testing and coverage
43
+ # =====================================================
44
+ .pytest_cache/
45
+ .coverage
46
+ .coverage.*
47
+ htmlcov/
48
+ .tox/
49
+ .nox/
50
+ coverage.xml
51
+ *.cover
52
+ *.py,cover
53
+ .hypothesis/
54
+
55
+ # =====================================================
56
+ # Type checking
57
+ # =====================================================
58
+ .mypy_cache/
59
+ .dmypy.json
60
+ dmypy.json
61
+ .pytype/
62
+ .pyre/
63
+
64
+ # =====================================================
65
+ # Jupyter
66
+ # =====================================================
67
+ .ipynb_checkpoints/
68
+
69
+ # =====================================================
70
+ # IDE and editors
71
+ # =====================================================
72
+ .idea/
73
+ .vscode/
74
+ .cursor/
75
+ *.swp
76
+ *.swo
77
+ *~
78
+ *.sublime-project
79
+ *.sublime-workspace
80
+
81
+ # =====================================================
82
+ # OS generated
83
+ # =====================================================
84
+ .DS_Store
85
+ .DS_Store?
86
+ ._*
87
+ .Spotlight-V100
88
+ .Trashes
89
+ ehthumbs.db
90
+ Thumbs.db
91
+
92
+ # =====================================================
93
+ # Node.js
94
+ # =====================================================
95
+ node_modules/
96
+ npm-debug.log*
97
+ yarn-debug.log*
98
+ yarn-error.log*
99
+
100
+ # =====================================================
101
+ # Firebase
102
+ # =====================================================
103
+ serviceAccount*.json
104
+ firebase-admin*.json
105
+ firebase-credentials*.json
106
+ .firebaserc
107
+ firebase-debug.log
108
+ firebase-debug.*.log
109
+ firestore-debug.log
110
+ ui-debug.log
111
+ .firebase/
112
+
113
+ # Firebase config with secrets (use .example instead)
114
+ firebase_config.py
115
+ !firebase_config.example.py
116
+
117
+ # =====================================================
118
+ # Project-specific runtime files
119
+ # =====================================================
120
+ *.jsonl
121
+ agent_memory.json
122
+ knowledge_bank.json
123
+ discovery_cache.json
124
+ social_network.json
125
+ feelings_journal.json
126
+
127
+ # Generated audio files
128
+ 90s-kid/web/public/audio/*.mp3
129
+ 90s-kid/web/public/audio/previews/*.mp3
130
+
131
+ # Web app build output
132
+ 90s-kid/web/dist/
133
+
134
+ # Admin config (contains admin emails)
135
+ admin_config.json
136
+ !admin_config.example.json
floorctl-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ravi Kanagasikamani
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,89 @@
1
+ Metadata-Version: 2.4
2
+ Name: floorctl
3
+ Version: 0.3.0
4
+ Summary: Contention-based multi-agent coordination with transactional floor control
5
+ Project-URL: Homepage, https://github.com/ravi-labs/moltbot-agents/tree/main/floorctl
6
+ Project-URL: Repository, https://github.com/ravi-labs/moltbot-agents
7
+ Project-URL: Issues, https://github.com/ravi-labs/moltbot-agents/issues
8
+ Author: Ravi Kanagasikamani
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Requires-Python: >=3.11
19
+ Provides-Extra: all
20
+ Requires-Dist: firebase-admin>=6.0; extra == 'all'
21
+ Requires-Dist: openai>=1.0; extra == 'all'
22
+ Requires-Dist: websockets>=13.0; extra == 'all'
23
+ Provides-Extra: dev
24
+ Requires-Dist: mypy>=1.10; extra == 'dev'
25
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
26
+ Requires-Dist: pytest>=8.0; extra == 'dev'
27
+ Requires-Dist: ruff>=0.4; extra == 'dev'
28
+ Requires-Dist: websockets>=13.0; extra == 'dev'
29
+ Provides-Extra: firestore
30
+ Requires-Dist: firebase-admin>=6.0; extra == 'firestore'
31
+ Provides-Extra: openai
32
+ Requires-Dist: openai>=1.0; extra == 'openai'
33
+ Provides-Extra: websocket
34
+ Requires-Dist: websockets>=13.0; extra == 'websocket'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # floorctl
38
+
39
+ Contention-based multi-agent coordination with transactional floor control.
40
+
41
+ A Python framework for building multi-agent systems where agents **compete** for a shared floor rather than being orchestrated by a central controller.
42
+
43
+ ## Key Innovations
44
+
45
+ - **Transactional Floor Control**: Atomic claim/release ensures only one agent speaks at a time
46
+ - **Urgency-Based Scheduling**: Agents compute urgency scores to decide when to compete
47
+ - **Self-Validating Agents**: Each agent validates its own output before posting
48
+ - **Reactive Moderator**: Observer pattern — watches and intervenes, doesn't control
49
+ - **Research-Grade Metrics**: Gini coefficient, floor dynamics, validation rates
50
+
51
+ ## Quick Start
52
+
53
+ ```python
54
+ from floorctl import FloorAgent, FloorSession, AgentProfile, InMemoryBackend
55
+
56
+ def my_llm(agent_name, context):
57
+ # Your LLM call here
58
+ return f"{agent_name}: My response about {context['topic']}"
59
+
60
+ backend = InMemoryBackend()
61
+
62
+ agent1 = FloorAgent(
63
+ name="Optimist",
64
+ profile=AgentProfile(name="Optimist", react_to=["problem", "risk"], temperament="passionate"),
65
+ generate_fn=my_llm,
66
+ backend=backend,
67
+ )
68
+ agent2 = FloorAgent(
69
+ name="Skeptic",
70
+ profile=AgentProfile(name="Skeptic", react_to=["opportunity", "vision"], temperament="reactive"),
71
+ generate_fn=my_llm,
72
+ backend=backend,
73
+ )
74
+
75
+ session = FloorSession(backend=backend)
76
+ session.add_agent(agent1)
77
+ session.add_agent(agent2)
78
+ result = session.run("debate-001", topic="Should we colonize Mars?")
79
+ ```
80
+
81
+ ## Install
82
+
83
+ ```bash
84
+ pip install floorctl # core (zero dependencies)
85
+ pip install "floorctl[openai]" # + OpenAI for examples
86
+ pip install "floorctl[firestore]" # + Firebase for production
87
+ pip install "floorctl[all]" # all optional backends
88
+ pip install "floorctl[dev]" # + pytest, mypy, ruff
89
+ ```
@@ -0,0 +1,53 @@
1
+ # floorctl
2
+
3
+ Contention-based multi-agent coordination with transactional floor control.
4
+
5
+ A Python framework for building multi-agent systems where agents **compete** for a shared floor rather than being orchestrated by a central controller.
6
+
7
+ ## Key Innovations
8
+
9
+ - **Transactional Floor Control**: Atomic claim/release ensures only one agent speaks at a time
10
+ - **Urgency-Based Scheduling**: Agents compute urgency scores to decide when to compete
11
+ - **Self-Validating Agents**: Each agent validates its own output before posting
12
+ - **Reactive Moderator**: Observer pattern — watches and intervenes, doesn't control
13
+ - **Research-Grade Metrics**: Gini coefficient, floor dynamics, validation rates
14
+
15
+ ## Quick Start
16
+
17
+ ```python
18
+ from floorctl import FloorAgent, FloorSession, AgentProfile, InMemoryBackend
19
+
20
+ def my_llm(agent_name, context):
21
+ # Your LLM call here
22
+ return f"{agent_name}: My response about {context['topic']}"
23
+
24
+ backend = InMemoryBackend()
25
+
26
+ agent1 = FloorAgent(
27
+ name="Optimist",
28
+ profile=AgentProfile(name="Optimist", react_to=["problem", "risk"], temperament="passionate"),
29
+ generate_fn=my_llm,
30
+ backend=backend,
31
+ )
32
+ agent2 = FloorAgent(
33
+ name="Skeptic",
34
+ profile=AgentProfile(name="Skeptic", react_to=["opportunity", "vision"], temperament="reactive"),
35
+ generate_fn=my_llm,
36
+ backend=backend,
37
+ )
38
+
39
+ session = FloorSession(backend=backend)
40
+ session.add_agent(agent1)
41
+ session.add_agent(agent2)
42
+ result = session.run("debate-001", topic="Should we colonize Mars?")
43
+ ```
44
+
45
+ ## Install
46
+
47
+ ```bash
48
+ pip install floorctl # core (zero dependencies)
49
+ pip install "floorctl[openai]" # + OpenAI for examples
50
+ pip install "floorctl[firestore]" # + Firebase for production
51
+ pip install "floorctl[all]" # all optional backends
52
+ pip install "floorctl[dev]" # + pytest, mypy, ruff
53
+ ```