trinity-agent 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 (81) hide show
  1. trinity_agent-0.1.0/.coverage +0 -0
  2. trinity_agent-0.1.0/.gitignore +6 -0
  3. trinity_agent-0.1.0/LICENSE +21 -0
  4. trinity_agent-0.1.0/PKG-INFO +145 -0
  5. trinity_agent-0.1.0/README.md +119 -0
  6. trinity_agent-0.1.0/docs/checkpoint.md +489 -0
  7. trinity_agent-0.1.0/docs/reference-architecture.md +667 -0
  8. trinity_agent-0.1.0/docs/test-results/phase-1-T.md +215 -0
  9. trinity_agent-0.1.0/docs/test-results/phase-2-T.md +157 -0
  10. trinity_agent-0.1.0/docs/test-results/phase-3-T.md +143 -0
  11. trinity_agent-0.1.0/docs/test-results/phase-4-T.md +267 -0
  12. trinity_agent-0.1.0/docs/test-results/phase-5-T.md +166 -0
  13. trinity_agent-0.1.0/pyproject.toml +57 -0
  14. trinity_agent-0.1.0/src/trinity/__init__.py +3 -0
  15. trinity_agent-0.1.0/src/trinity/__main__.py +6 -0
  16. trinity_agent-0.1.0/src/trinity/agents/__init__.py +0 -0
  17. trinity_agent-0.1.0/src/trinity/agents/base.py +67 -0
  18. trinity_agent-0.1.0/src/trinity/agents/claude_agent.py +424 -0
  19. trinity_agent-0.1.0/src/trinity/agents/codex_agent.py +201 -0
  20. trinity_agent-0.1.0/src/trinity/agents/factory.py +126 -0
  21. trinity_agent-0.1.0/src/trinity/agents/gemini_agent.py +204 -0
  22. trinity_agent-0.1.0/src/trinity/cli.py +401 -0
  23. trinity_agent-0.1.0/src/trinity/completion/__init__.py +0 -0
  24. trinity_agent-0.1.0/src/trinity/completion/base.py +139 -0
  25. trinity_agent-0.1.0/src/trinity/completion/hook.py +115 -0
  26. trinity_agent-0.1.0/src/trinity/completion/idle.py +82 -0
  27. trinity_agent-0.1.0/src/trinity/completion/prompt.py +88 -0
  28. trinity_agent-0.1.0/src/trinity/config.py +215 -0
  29. trinity_agent-0.1.0/src/trinity/context/__init__.py +0 -0
  30. trinity_agent-0.1.0/src/trinity/context/monitor.py +139 -0
  31. trinity_agent-0.1.0/src/trinity/context/rotator.py +153 -0
  32. trinity_agent-0.1.0/src/trinity/context/shared.py +211 -0
  33. trinity_agent-0.1.0/src/trinity/deliberation/__init__.py +0 -0
  34. trinity_agent-0.1.0/src/trinity/deliberation/consensus.py +171 -0
  35. trinity_agent-0.1.0/src/trinity/deliberation/distributor.py +113 -0
  36. trinity_agent-0.1.0/src/trinity/deliberation/protocol.py +218 -0
  37. trinity_agent-0.1.0/src/trinity/error_handler.py +252 -0
  38. trinity_agent-0.1.0/src/trinity/health/__init__.py +0 -0
  39. trinity_agent-0.1.0/src/trinity/health/checker.py +154 -0
  40. trinity_agent-0.1.0/src/trinity/logging.py +66 -0
  41. trinity_agent-0.1.0/src/trinity/models.py +159 -0
  42. trinity_agent-0.1.0/src/trinity/orchestrator.py +227 -0
  43. trinity_agent-0.1.0/src/trinity/retry.py +175 -0
  44. trinity_agent-0.1.0/src/trinity/tmux/__init__.py +0 -0
  45. trinity_agent-0.1.0/src/trinity/tmux/pane.py +134 -0
  46. trinity_agent-0.1.0/src/trinity/tmux/session.py +158 -0
  47. trinity_agent-0.1.0/src/trinity/workspace/__init__.py +1 -0
  48. trinity_agent-0.1.0/src/trinity/workspace/isolation.py +207 -0
  49. trinity_agent-0.1.0/src/trinity/workspace/managed_home.py +205 -0
  50. trinity_agent-0.1.0/templates/trinity.config.example +50 -0
  51. trinity_agent-0.1.0/tests/conftest.py +60 -0
  52. trinity_agent-0.1.0/tests/test_agent_factory.py +225 -0
  53. trinity_agent-0.1.0/tests/test_claude_agent.py +256 -0
  54. trinity_agent-0.1.0/tests/test_cli.py +244 -0
  55. trinity_agent-0.1.0/tests/test_cli_v2.py +129 -0
  56. trinity_agent-0.1.0/tests/test_codex_agent.py +163 -0
  57. trinity_agent-0.1.0/tests/test_completion.py +330 -0
  58. trinity_agent-0.1.0/tests/test_config.py +84 -0
  59. trinity_agent-0.1.0/tests/test_consensus_v2.py +122 -0
  60. trinity_agent-0.1.0/tests/test_context_monitor.py +189 -0
  61. trinity_agent-0.1.0/tests/test_deliberation.py +148 -0
  62. trinity_agent-0.1.0/tests/test_e2e.py +148 -0
  63. trinity_agent-0.1.0/tests/test_error_handling.py +200 -0
  64. trinity_agent-0.1.0/tests/test_gemini_agent.py +154 -0
  65. trinity_agent-0.1.0/tests/test_health_checker.py +289 -0
  66. trinity_agent-0.1.0/tests/test_interactive_claude.py +246 -0
  67. trinity_agent-0.1.0/tests/test_logging.py +87 -0
  68. trinity_agent-0.1.0/tests/test_managed_home.py +197 -0
  69. trinity_agent-0.1.0/tests/test_models.py +154 -0
  70. trinity_agent-0.1.0/tests/test_multi_provider.py +267 -0
  71. trinity_agent-0.1.0/tests/test_orchestrator.py +276 -0
  72. trinity_agent-0.1.0/tests/test_protocol.py +316 -0
  73. trinity_agent-0.1.0/tests/test_protocol_v2.py +139 -0
  74. trinity_agent-0.1.0/tests/test_retry.py +162 -0
  75. trinity_agent-0.1.0/tests/test_session_handoff.py +66 -0
  76. trinity_agent-0.1.0/tests/test_session_rotator.py +172 -0
  77. trinity_agent-0.1.0/tests/test_shared_context.py +101 -0
  78. trinity_agent-0.1.0/tests/test_tmux.py +196 -0
  79. trinity_agent-0.1.0/tests/test_tmux_integration.py +181 -0
  80. trinity_agent-0.1.0/tests/test_workspace.py +287 -0
  81. trinity_agent-0.1.0/uv.lock +373 -0
Binary file
@@ -0,0 +1,6 @@
1
+ .trinity/
2
+ .trinity/
3
+ __pycache__/
4
+ .venv/
5
+ *.egg-info/
6
+ .pytest_cache/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Trinity 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,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: trinity-agent
3
+ Version: 0.1.0
4
+ Summary: Three minds, one context — Multi-agent AI orchestrator for Claude Code, Codex, and Gemini CLI.
5
+ Project-URL: Homepage, https://github.com/hongdangmoo49/Trinity
6
+ Project-URL: Repository, https://github.com/hongdangmoo49/Trinity
7
+ Project-URL: Issues, https://github.com/hongdangmoo49/Trinity/issues
8
+ Author: Trinity Contributors
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,claude,codex,deliberation,gemini,multi-agent,orchestrator
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: click>=8.1
23
+ Requires-Dist: rich>=13.0
24
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Trinity Agent
28
+
29
+ **Three minds, one context.** Multi-agent AI orchestrator that unifies Claude Code, Codex, and Gemini CLI through shared context, round-based deliberation, and task distribution.
30
+
31
+ ## Quick Start
32
+
33
+ ```bash
34
+ # Install
35
+ pip install trinity-agent
36
+
37
+ # Initialize in your project
38
+ trinity init
39
+
40
+ # Run a deliberation
41
+ trinity ask "인증 시스템 아키텍처를 설계해줘"
42
+
43
+ # Interactive mode (tmux)
44
+ trinity ask "질문" --interactive
45
+ ```
46
+
47
+ ## How It Works
48
+
49
+ ```
50
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
51
+ │ Claude │ │ Codex │ │ Gemini │
52
+ │ (Architect)│ │(Implementer)│ │ (Reviewer) │
53
+ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
54
+ │ │ │
55
+ └───────────┬───────┴───────────────────┘
56
+
57
+ ┌───────┴───────┐
58
+ │ Orchestrator │
59
+ │ Shared Context│
60
+ │ Consensus │
61
+ └───────────────┘
62
+ ```
63
+
64
+ 1. **Shared Context** — All agents read/write to a shared markdown file
65
+ 2. **Round-based Deliberation** — Agents discuss in rounds until consensus
66
+ 3. **Consensus Detection** — Keyword-based agreement detection
67
+ 4. **Task Distribution** — Assign tasks based on agent strengths
68
+
69
+ ## Commands
70
+
71
+ | Command | Description |
72
+ |---------|-------------|
73
+ | `trinity init` | Initialize `.trinity/` in current directory |
74
+ | `trinity ask "question"` | Run deliberation on a prompt |
75
+ | `trinity status` | Show agent status |
76
+ | `trinity context` | Display shared context |
77
+ | `trinity config [key]` | Show configuration |
78
+ | `trinity logs` | View orchestrator logs |
79
+ | `trinity reset --keep-context` | Reset session (preserve context) |
80
+ | `trinity attach` | Attach to tmux session |
81
+ | `trinity status-watch` | Live status dashboard |
82
+
83
+ ## Configuration
84
+
85
+ Edit `.trinity/trinity.config`:
86
+
87
+ ```toml
88
+ [general]
89
+ session_name = "trinity"
90
+ max_deliberation_rounds = 5
91
+ consensus_threshold = 0.6
92
+
93
+ [agents.claude]
94
+ provider = "claude-code"
95
+ cli_command = "claude"
96
+ role_prompt = "You are the Architect..."
97
+ enabled = true
98
+
99
+ [agents.codex]
100
+ provider = "codex"
101
+ cli_command = "codex"
102
+ role_prompt = "You are the Implementer..."
103
+ enabled = true
104
+
105
+ [agents.gemini]
106
+ provider = "gemini-cli"
107
+ cli_command = "gemini"
108
+ role_prompt = "You are the Reviewer..."
109
+ enabled = true
110
+ ```
111
+
112
+ ## Architecture
113
+
114
+ | Module | Description |
115
+ |--------|-------------|
116
+ | `trinity.orchestrator` | Top-level coordinator |
117
+ | `trinity.agents` | Provider-specific agent wrappers (Claude, Codex, Gemini) |
118
+ | `trinity.deliberation` | Protocol, consensus, task distribution |
119
+ | `trinity.completion` | Completion detection (Hook, PromptReturn, Idle) |
120
+ | `trinity.context` | Shared context engine, monitor, session rotation |
121
+ | `trinity.health` | Agent health monitoring |
122
+ | `trinity.workspace` | Workspace isolation (git worktree), managed home |
123
+ | `trinity.retry` | Retry with exponential backoff |
124
+ | `trinity.error_handler` | Crash recovery and agent respawn |
125
+
126
+ ## Requirements
127
+
128
+ - Python 3.10+
129
+ - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) (optional)
130
+ - [Codex CLI](https://github.com/openai/codex) (optional)
131
+ - [Gemini CLI](https://github.com/google-gemini/gemini-cli) (optional)
132
+ - tmux (for interactive mode)
133
+
134
+ ## Development
135
+
136
+ ```bash
137
+ git clone https://github.com/hongdangmoo49/Trinity.git
138
+ cd Trinity
139
+ uv sync
140
+ uv run pytest tests/ -v
141
+ ```
142
+
143
+ ## License
144
+
145
+ MIT
@@ -0,0 +1,119 @@
1
+ # Trinity Agent
2
+
3
+ **Three minds, one context.** Multi-agent AI orchestrator that unifies Claude Code, Codex, and Gemini CLI through shared context, round-based deliberation, and task distribution.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # Install
9
+ pip install trinity-agent
10
+
11
+ # Initialize in your project
12
+ trinity init
13
+
14
+ # Run a deliberation
15
+ trinity ask "인증 시스템 아키텍처를 설계해줘"
16
+
17
+ # Interactive mode (tmux)
18
+ trinity ask "질문" --interactive
19
+ ```
20
+
21
+ ## How It Works
22
+
23
+ ```
24
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
25
+ │ Claude │ │ Codex │ │ Gemini │
26
+ │ (Architect)│ │(Implementer)│ │ (Reviewer) │
27
+ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
28
+ │ │ │
29
+ └───────────┬───────┴───────────────────┘
30
+
31
+ ┌───────┴───────┐
32
+ │ Orchestrator │
33
+ │ Shared Context│
34
+ │ Consensus │
35
+ └───────────────┘
36
+ ```
37
+
38
+ 1. **Shared Context** — All agents read/write to a shared markdown file
39
+ 2. **Round-based Deliberation** — Agents discuss in rounds until consensus
40
+ 3. **Consensus Detection** — Keyword-based agreement detection
41
+ 4. **Task Distribution** — Assign tasks based on agent strengths
42
+
43
+ ## Commands
44
+
45
+ | Command | Description |
46
+ |---------|-------------|
47
+ | `trinity init` | Initialize `.trinity/` in current directory |
48
+ | `trinity ask "question"` | Run deliberation on a prompt |
49
+ | `trinity status` | Show agent status |
50
+ | `trinity context` | Display shared context |
51
+ | `trinity config [key]` | Show configuration |
52
+ | `trinity logs` | View orchestrator logs |
53
+ | `trinity reset --keep-context` | Reset session (preserve context) |
54
+ | `trinity attach` | Attach to tmux session |
55
+ | `trinity status-watch` | Live status dashboard |
56
+
57
+ ## Configuration
58
+
59
+ Edit `.trinity/trinity.config`:
60
+
61
+ ```toml
62
+ [general]
63
+ session_name = "trinity"
64
+ max_deliberation_rounds = 5
65
+ consensus_threshold = 0.6
66
+
67
+ [agents.claude]
68
+ provider = "claude-code"
69
+ cli_command = "claude"
70
+ role_prompt = "You are the Architect..."
71
+ enabled = true
72
+
73
+ [agents.codex]
74
+ provider = "codex"
75
+ cli_command = "codex"
76
+ role_prompt = "You are the Implementer..."
77
+ enabled = true
78
+
79
+ [agents.gemini]
80
+ provider = "gemini-cli"
81
+ cli_command = "gemini"
82
+ role_prompt = "You are the Reviewer..."
83
+ enabled = true
84
+ ```
85
+
86
+ ## Architecture
87
+
88
+ | Module | Description |
89
+ |--------|-------------|
90
+ | `trinity.orchestrator` | Top-level coordinator |
91
+ | `trinity.agents` | Provider-specific agent wrappers (Claude, Codex, Gemini) |
92
+ | `trinity.deliberation` | Protocol, consensus, task distribution |
93
+ | `trinity.completion` | Completion detection (Hook, PromptReturn, Idle) |
94
+ | `trinity.context` | Shared context engine, monitor, session rotation |
95
+ | `trinity.health` | Agent health monitoring |
96
+ | `trinity.workspace` | Workspace isolation (git worktree), managed home |
97
+ | `trinity.retry` | Retry with exponential backoff |
98
+ | `trinity.error_handler` | Crash recovery and agent respawn |
99
+
100
+ ## Requirements
101
+
102
+ - Python 3.10+
103
+ - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) (optional)
104
+ - [Codex CLI](https://github.com/openai/codex) (optional)
105
+ - [Gemini CLI](https://github.com/google-gemini/gemini-cli) (optional)
106
+ - tmux (for interactive mode)
107
+
108
+ ## Development
109
+
110
+ ```bash
111
+ git clone https://github.com/hongdangmoo49/Trinity.git
112
+ cd Trinity
113
+ uv sync
114
+ uv run pytest tests/ -v
115
+ ```
116
+
117
+ ## License
118
+
119
+ MIT