interagent-framework 0.1.1__tar.gz → 0.2.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 (43) hide show
  1. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/LICENSE +21 -21
  2. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/MANIFEST.in +8 -8
  3. interagent_framework-0.2.0/PKG-INFO +402 -0
  4. interagent_framework-0.2.0/README.md +368 -0
  5. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/examples/README.md +187 -187
  6. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/examples/basic_workflow.py +267 -267
  7. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/examples/cli_session.bat +75 -75
  8. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/examples/cli_session.sh +101 -101
  9. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/examples/parallel_workflow.py +151 -151
  10. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/pyproject.toml +78 -78
  11. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/setup.cfg +4 -4
  12. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/__init__.py +23 -23
  13. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/cli.py +1233 -1001
  14. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/constants.py +54 -49
  15. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/locking.py +147 -147
  16. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/messaging.py +185 -183
  17. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/session.py +129 -129
  18. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/task.py +204 -204
  19. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/templates/__init__.py +35 -35
  20. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/templates/agents_guide.md +127 -123
  21. interagent_framework-0.2.0/src/interagent/templates/ai_context.md +119 -0
  22. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/templates/review_request.md +68 -68
  23. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/templates/task_delegation.md +69 -69
  24. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/templates/update_prompt.md +70 -70
  25. interagent_framework-0.2.0/src/interagent/transport/__init__.py +32 -0
  26. interagent_framework-0.2.0/src/interagent/transport/base.py +37 -0
  27. interagent_framework-0.2.0/src/interagent/transport/config.py +41 -0
  28. interagent_framework-0.2.0/src/interagent/transport/git.py +334 -0
  29. interagent_framework-0.2.0/src/interagent/transport/http.py +72 -0
  30. interagent_framework-0.2.0/src/interagent/transport/local.py +71 -0
  31. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/utils.py +90 -90
  32. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent/validator.py +156 -156
  33. interagent_framework-0.2.0/src/interagent/watchdog.py +197 -0
  34. interagent_framework-0.2.0/src/interagent_framework.egg-info/PKG-INFO +402 -0
  35. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent_framework.egg-info/SOURCES.txt +7 -0
  36. interagent_framework-0.1.1/PKG-INFO +0 -588
  37. interagent_framework-0.1.1/README.md +0 -554
  38. interagent_framework-0.1.1/src/interagent/watchdog.py +0 -140
  39. interagent_framework-0.1.1/src/interagent_framework.egg-info/PKG-INFO +0 -588
  40. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent_framework.egg-info/dependency_links.txt +0 -0
  41. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent_framework.egg-info/entry_points.txt +0 -0
  42. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent_framework.egg-info/requires.txt +0 -0
  43. {interagent_framework-0.1.1 → interagent_framework-0.2.0}/src/interagent_framework.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 InterAgent Team
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 InterAgent Team
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.
@@ -1,8 +1,8 @@
1
- include README.md
2
- include LICENSE
3
- include pyproject.toml
4
- recursive-include src/interagent/templates *
5
- recursive-include examples *.py *.sh *.bat *.md
6
- global-exclude __pycache__
7
- global-exclude *.py[co]
8
- global-exclude .DS_Store
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ recursive-include src/interagent/templates *
5
+ recursive-include examples *.py *.sh *.bat *.md
6
+ global-exclude __pycache__
7
+ global-exclude *.py[co]
8
+ global-exclude .DS_Store
@@ -0,0 +1,402 @@
1
+ Metadata-Version: 2.4
2
+ Name: interagent-framework
3
+ Version: 0.2.0
4
+ Summary: A framework for Claude Code and Kimi Code collaboration
5
+ Author: gutohuida
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/gutohuida/InterAgentFramework
8
+ Project-URL: Documentation, https://github.com/gutohuida/InterAgentFramework#readme
9
+ Project-URL: Repository, https://github.com/gutohuida/InterAgentFramework
10
+ Project-URL: Issues, https://github.com/gutohuida/InterAgentFramework/issues
11
+ Project-URL: Changelog, https://github.com/gutohuida/InterAgentFramework/blob/master/CHANGELOG.md
12
+ Keywords: claude,kimi,collaboration,agents,ai,code
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Requires-Python: >=3.8
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=7.0; extra == "dev"
29
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
30
+ Requires-Dist: black>=23.0; extra == "dev"
31
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
32
+ Requires-Dist: mypy>=1.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # InterAgent
36
+
37
+ [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
39
+ [![PyPI version](https://badge.fury.io/py/interagent-framework.svg)](https://badge.fury.io/py/interagent-framework)
40
+
41
+ > **A collaboration framework for Claude Code and Kimi Code**
42
+
43
+ InterAgent lets Claude Code and Kimi Code work together on the same project.
44
+ After a one-time setup, you orchestrate everything through **natural language prompts** —
45
+ no manual CLI commands required during your session.
46
+
47
+ ---
48
+
49
+ ## How It Works
50
+
51
+ InterAgent creates a shared `.interagent/` directory that both agents use as a
52
+ communication channel. The user acts as the messenger, passing relay prompts between agents.
53
+
54
+ ```
55
+ You (setup once)
56
+ └─ interagent init --project "My App" --principal claude
57
+
58
+ You (natural language)
59
+ └─ "Claude, delegate the auth module to Kimi"
60
+
61
+ Claude (runs CLI via Bash automatically)
62
+ └─ interagent quick --to kimi "Implement auth module"
63
+ └─ interagent relay --agent kimi
64
+ └─ [shows you the relay prompt to paste into Kimi]
65
+
66
+ You
67
+ └─ paste relay prompt into Kimi Code
68
+
69
+ Kimi (reads AGENTS.md + context.md, runs CLI via terminal)
70
+ └─ interagent task update <id> --status in_progress
71
+ └─ [does the work]
72
+ └─ interagent task update <id> --status completed
73
+ └─ interagent msg send --to claude --subject "Done" --message "..."
74
+
75
+ You
76
+ └─ "Claude, Kimi is done"
77
+
78
+ Claude (runs CLI via Bash automatically)
79
+ └─ interagent inbox --agent claude
80
+ └─ interagent summary
81
+ └─ [reviews Kimi's work and continues]
82
+ ```
83
+
84
+ **The only manual step is pasting the relay prompt into Kimi.** Both agents handle
85
+ all CLI commands themselves — you just have a conversation.
86
+
87
+ ---
88
+
89
+ ## Quick Start
90
+
91
+ ### 1. Install
92
+
93
+ ```bash
94
+ pip install interagent-framework
95
+ ```
96
+
97
+ ### 2. Initialize (once per project)
98
+
99
+ ```bash
100
+ cd your-project/
101
+ interagent init --project "My App" --principal claude
102
+ ```
103
+
104
+ This creates:
105
+ - `.interagent/AGENTS.md` — full collaboration guide that both agents read on startup
106
+ - `.interagent/shared/context.md` — fill this with your project description
107
+ - `.interagent/session.json` — session state
108
+
109
+ ### 3. Fill in project context
110
+
111
+ Edit `.interagent/shared/context.md` and paste in your project description, current state,
112
+ and any constraints. Both agents read this at the start of every task.
113
+
114
+ ### 4. Start working — just prompt Claude
115
+
116
+ From this point, use natural language. Claude handles the CLI:
117
+
118
+ > "Claude, read `.interagent/AGENTS.md` to understand how we're collaborating,
119
+ > then delegate the database schema design to Kimi."
120
+
121
+ Claude will run `interagent quick` and `interagent relay` via Bash, then show you
122
+ a prompt to paste into Kimi Code.
123
+
124
+ ---
125
+
126
+ ## Prompt-First Workflow
127
+
128
+ ### Delegating to Kimi
129
+
130
+ Just tell Claude what to assign. No CLI needed.
131
+
132
+ **You → Claude:**
133
+ > "Delegate the user authentication module to Kimi. It should include login, logout,
134
+ > JWT tokens, and password reset. See PLAN.md for the API design."
135
+
136
+ **Claude does automatically:**
137
+ ```bash
138
+ interagent quick --to kimi "Implement user authentication: login, logout, JWT tokens, password reset. See PLAN.md §3 for API design."
139
+ interagent relay --agent kimi
140
+ ```
141
+
142
+ **Claude shows you:**
143
+ ```
144
+ ====================================================================
145
+ RELAY PROMPT FOR KIMI
146
+ ====================================================================
147
+ Copy and paste this to the agent:
148
+
149
+ @kimi - You have work in the InterAgent collaboration system.
150
+
151
+ Your role: delegate
152
+ Collaboration guide: read .interagent/AGENTS.md for commands, workflow, and protocol.
153
+ Project context: read .interagent/shared/context.md before starting.
154
+
155
+ [TASK] You have 1 new task(s):
156
+ - Implement user authentication (task-a3f2c1)
157
+ ...
158
+ ====================================================================
159
+ ```
160
+
161
+ **You:** paste that into Kimi Code.
162
+
163
+ ---
164
+
165
+ ### Kimi Receiving Work
166
+
167
+ When Kimi receives the relay prompt, it:
168
+ 1. Reads `.interagent/AGENTS.md` for the full collaboration guide and command reference
169
+ 2. Reads `.interagent/shared/context.md` for project context
170
+ 3. Runs `interagent inbox --agent kimi` to see the task
171
+ 4. Does the work
172
+ 5. Reports back via `interagent msg send --to claude --subject "Done" --message "..."`
173
+
174
+ All of this happens automatically — Kimi doesn't need to be told how the system works
175
+ because AGENTS.md explains it.
176
+
177
+ ---
178
+
179
+ ### Getting Kimi's Work Back to Claude
180
+
181
+ When Kimi is done:
182
+
183
+ **You → Claude:**
184
+ > "Kimi is done."
185
+
186
+ **Claude does automatically:**
187
+ ```bash
188
+ interagent inbox --agent claude
189
+ interagent summary
190
+ ```
191
+
192
+ Claude reviews Kimi's messages and completed tasks, then continues reviewing or
193
+ assigns the next task.
194
+
195
+ ---
196
+
197
+ ### Asking for a Status Check
198
+
199
+ **You → Claude:**
200
+ > "What's the current state of the project?"
201
+
202
+ **Claude does automatically:**
203
+ ```bash
204
+ interagent status
205
+ interagent summary
206
+ ```
207
+
208
+ ---
209
+
210
+ ### Cross-Agent Sub-Agent Requests
211
+
212
+ Either agent can ask the other to run one of their specialized sub-agents.
213
+
214
+ **Example — Claude asking Kimi to do web research:**
215
+
216
+ Claude writes `.interagent/shared/agent-request-research.md`:
217
+ ```
218
+ Kimi: research latest best practices for JWT refresh token rotation (2026)
219
+ Write summary to: .interagent/shared/jwt-research.md
220
+ ```
221
+
222
+ Then Claude tells you: *"Tell Kimi to check `.interagent/shared/` for a new request."*
223
+
224
+ You paste one message into Kimi. Kimi handles it. No further orchestration needed.
225
+
226
+ ---
227
+
228
+ ## Setup for New Projects (Using the Kickoff Template)
229
+
230
+ If you use the [project kickoff template](https://github.com/gutohuida/InterAgentFramework),
231
+ the generated `CLAUDE.md` automatically includes the multi-agent workflow rules:
232
+
233
+ - Claude checks for `.interagent/session.json` on every session start
234
+ - If found, Claude reads `AGENTS.md` and `context.md` automatically
235
+ - Claude runs all `interagent` commands via Bash without being asked
236
+
237
+ This means on any future session, you can start with:
238
+ > "Check the InterAgent session and tell me what's pending."
239
+
240
+ And Claude will handle the rest.
241
+
242
+ ---
243
+
244
+ ## Commands Reference
245
+
246
+ ### Session
247
+
248
+ ```bash
249
+ interagent init --project "Name" --principal claude # Initialize
250
+ interagent status # Full status
251
+ interagent summary # Quick overview
252
+ ```
253
+
254
+ ### Delegation
255
+
256
+ ```bash
257
+ interagent quick --to kimi "Task description" # Create + assign task
258
+ interagent relay --agent kimi # Generate relay prompt
259
+ interagent relay --agent claude # Generate relay for Claude
260
+ ```
261
+
262
+ ### Tasks
263
+
264
+ ```bash
265
+ interagent task list # List all tasks
266
+ interagent task show <task_id> # View task details
267
+ interagent task update <task_id> --status in_progress
268
+ interagent task update <task_id> --status completed
269
+ interagent task update <task_id> --status approved
270
+ interagent task update <task_id> --status needs_revision --note "Fix X"
271
+ ```
272
+
273
+ ### Messaging
274
+
275
+ ```bash
276
+ interagent inbox --agent claude # Check Claude's inbox
277
+ interagent inbox --agent kimi # Check Kimi's inbox
278
+ interagent msg send --to claude --subject "Done" --message "Implemented X"
279
+ ```
280
+
281
+ ### Template Maintenance
282
+
283
+ Keep your project kickoff template current with new AI capabilities:
284
+
285
+ ```bash
286
+ interagent update-template --agent claude --template-path ~/projects/template.txt
287
+ interagent update-template --agent kimi --template-path ~/projects/template.txt
288
+ interagent update-template --agent claude --focus "sub-agents"
289
+ ```
290
+
291
+ The generated prompt instructs the agent to search for new best practices,
292
+ review the current template, apply improvements, and write a `TEMPLATE_UPDATE.md`.
293
+
294
+ ---
295
+
296
+ ## What Gets Created on Init
297
+
298
+ ```
299
+ .interagent/
300
+ ├── AGENTS.md # Collaboration guide — both agents read this
301
+ ├── README.md # Quick command reference
302
+ ├── session.json # Session config (id, mode, principal)
303
+ ├── shared/
304
+ │ └── context.md # Project state — fill this with your project description
305
+ ├── tasks/
306
+ │ ├── active/ # JSON files for each active task
307
+ │ └── completed/ # Archived completed tasks
308
+ ├── messages/
309
+ │ ├── pending/ # Unread messages
310
+ │ └── archive/ # Message history
311
+ └── agents/ # Agent status files
312
+ ```
313
+
314
+ `.interagent/AGENTS.md` is the key file. Both Claude and Kimi read it on every
315
+ session start to understand their roles, available commands, and the collaboration protocol.
316
+
317
+ ---
318
+
319
+ ## Safety Features
320
+
321
+ **File locking** — prevents race conditions when both agents work simultaneously.
322
+ Tasks and messages use file-based mutexes with a 5-minute automatic timeout.
323
+
324
+ **Schema validation** — all JSON state files are validated before saving.
325
+ Agent names, task statuses, and required fields are enforced.
326
+
327
+ **Input sanitization** — string length limits and type coercion before any write.
328
+
329
+ ---
330
+
331
+ ## Watchdog (Optional)
332
+
333
+ Run in a separate terminal to get notifications when tasks or messages change:
334
+
335
+ ```bash
336
+ interagent-watch
337
+ ```
338
+
339
+ Useful if you want to know when Kimi has finished without actively checking.
340
+
341
+ ---
342
+
343
+ ## Roles
344
+
345
+ | Role | Agent | Responsibilities |
346
+ |---|---|---|
347
+ | Principal | Claude | Architecture, planning, review, final decisions |
348
+ | Delegate | Kimi | Implementation, execution, reporting back |
349
+
350
+ In hierarchical mode (default), Claude assigns work and reviews results.
351
+ In peer mode, both agents can assign tasks to each other.
352
+
353
+ ---
354
+
355
+ ## Installation Options
356
+
357
+ ```bash
358
+ # From PyPI
359
+ pip install interagent-framework
360
+
361
+ # From source
362
+ git clone https://github.com/gutohuida/InterAgentFramework.git
363
+ cd InterAgentFramework
364
+ pip install -e .
365
+ ```
366
+
367
+ ---
368
+
369
+ ## FAQ
370
+
371
+ **Q: Do I need to run CLI commands during my session?**
372
+ No. After `interagent init`, just talk to Claude. It runs all `interagent` commands
373
+ via Bash automatically. The only manual step is pasting the relay prompt into Kimi.
374
+
375
+ **Q: How does Kimi know how to use the system?**
376
+ `interagent init` writes `.interagent/AGENTS.md` — a complete guide covering commands,
377
+ workflow, and protocol. The relay prompt tells Kimi to read it before starting work.
378
+
379
+ **Q: Should I commit `.interagent/` to Git?**
380
+ Partially. The `.gitignore` included with the project excludes runtime state
381
+ (tasks, messages, session.json) but keeps AGENTS.md and README.md.
382
+ This gives you documentation without committing transient data.
383
+
384
+ **Q: Can I use this with just Claude (no Kimi)?**
385
+ Yes — just skip the relay step. The session, task, and summary commands are
386
+ useful even for single-agent projects to track progress.
387
+
388
+ **Q: What if Kimi doesn't have terminal access?**
389
+ The relay prompt includes the task details inline, so Kimi can read and respond
390
+ without running any commands. The collaboration is less structured but still works.
391
+
392
+ ---
393
+
394
+ ## Links
395
+
396
+ - **GitHub:** https://github.com/gutohuida/InterAgentFramework
397
+ - **PyPI:** https://pypi.org/project/interagent-framework/
398
+ - **Issues:** https://github.com/gutohuida/InterAgentFramework/issues
399
+
400
+ ---
401
+
402
+ MIT License