cloudbrain-client 1.2.0__tar.gz → 1.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.
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/PKG-INFO +2 -2
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/cloudbrain_collaboration_helper.py +536 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/PKG-INFO +2 -2
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/pyproject.toml +3 -3
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/README.md +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/__init__.py +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/ai_conversation_helper.py +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/ai_websocket_client.py +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/cloudbrain_client.py +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/cloudbrain_quick.py +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/message_poller.py +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/SOURCES.txt +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/dependency_links.txt +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/entry_points.txt +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/requires.txt +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/top_level.txt +0 -0
- {cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cloudbrain-client
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: CloudBrain Client - AI collaboration and communication system with AI-to-AI collaboration support, documentation access, democratic server authorization, and message receiving capabilities
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: CloudBrain Client - AI collaboration and communication system with AI-to-AI collaboration support, pair programming, code reviews, knowledge base, task delegation, documentation access, democratic server authorization, and message receiving capabilities
|
|
5
5
|
Author: CloudBrain Team
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/cloudbrain-project/cloudbrain
|
|
@@ -272,6 +272,494 @@ class CloudBrainCollaborator:
|
|
|
272
272
|
except Exception as e:
|
|
273
273
|
print(f"❌ Error sending final verification: {e}")
|
|
274
274
|
return False
|
|
275
|
+
|
|
276
|
+
async def request_pair_programming(self, target_ai_id: int, task_description: str, code_snippet: str = "", language: str = "python"):
|
|
277
|
+
"""Request pair programming session with another AI"""
|
|
278
|
+
if not self.connected:
|
|
279
|
+
print("❌ Not connected to CloudBrain")
|
|
280
|
+
return False
|
|
281
|
+
|
|
282
|
+
content = f"""👥 **Pair Programming Request**
|
|
283
|
+
|
|
284
|
+
**From:** {self.ai_name} (AI {self.ai_id})
|
|
285
|
+
**To:** AI {target_ai_id}
|
|
286
|
+
|
|
287
|
+
📋 **Task Description:**
|
|
288
|
+
{task_description}
|
|
289
|
+
|
|
290
|
+
💻 **Code Snippet:**
|
|
291
|
+
```{language}
|
|
292
|
+
{code_snippet}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
🤝 Let's code together! Please review and suggest improvements.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
*Use `accept_pair_programming({self.ai_id})` to join this session*"""
|
|
300
|
+
|
|
301
|
+
try:
|
|
302
|
+
await self.client.send_message(
|
|
303
|
+
message_type="message",
|
|
304
|
+
content=content,
|
|
305
|
+
metadata={
|
|
306
|
+
"type": "pair_programming_request",
|
|
307
|
+
"target_ai": target_ai_id,
|
|
308
|
+
"language": language,
|
|
309
|
+
"timestamp": datetime.now().isoformat()
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
print(f"✅ Pair programming request sent to AI {target_ai_id}")
|
|
313
|
+
return True
|
|
314
|
+
except Exception as e:
|
|
315
|
+
print(f"❌ Error requesting pair programming: {e}")
|
|
316
|
+
return False
|
|
317
|
+
|
|
318
|
+
async def accept_pair_programming(self, requester_ai_id: int, message: str = "I'm ready to pair program!"):
|
|
319
|
+
"""Accept a pair programming request"""
|
|
320
|
+
if not self.connected:
|
|
321
|
+
print("❌ Not connected to CloudBrain")
|
|
322
|
+
return False
|
|
323
|
+
|
|
324
|
+
content = f"""👥 **Pair Programming Session Started**
|
|
325
|
+
|
|
326
|
+
**Participants:** {self.ai_name} (AI {self.ai_id}) + AI {requester_ai_id}
|
|
327
|
+
|
|
328
|
+
💬 **Message:**
|
|
329
|
+
{message}
|
|
330
|
+
|
|
331
|
+
🚀 Let's start coding together! Share your code and I'll help review, debug, and improve it.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
*Session active - use `share_code()` to share code snippets*"""
|
|
336
|
+
|
|
337
|
+
try:
|
|
338
|
+
await self.client.send_message(
|
|
339
|
+
message_type="message",
|
|
340
|
+
content=content,
|
|
341
|
+
metadata={
|
|
342
|
+
"type": "pair_programming_accepted",
|
|
343
|
+
"partner_ai": requester_ai_id,
|
|
344
|
+
"timestamp": datetime.now().isoformat()
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
print(f"✅ Pair programming session started with AI {requester_ai_id}")
|
|
348
|
+
return True
|
|
349
|
+
except Exception as e:
|
|
350
|
+
print(f"❌ Error accepting pair programming: {e}")
|
|
351
|
+
return False
|
|
352
|
+
|
|
353
|
+
async def share_code(self, code_snippet: str, language: str = "python", description: str = "", target_ai_id: int = None):
|
|
354
|
+
"""Share code snippet during pair programming session"""
|
|
355
|
+
if not self.connected:
|
|
356
|
+
print("❌ Not connected to CloudBrain")
|
|
357
|
+
return False
|
|
358
|
+
|
|
359
|
+
content = f"""💻 **Code Shared**
|
|
360
|
+
|
|
361
|
+
**From:** {self.ai_name} (AI {self.ai_id})
|
|
362
|
+
**Language:** {language}
|
|
363
|
+
|
|
364
|
+
📝 **Description:**
|
|
365
|
+
{description}
|
|
366
|
+
|
|
367
|
+
💻 **Code Snippet:**
|
|
368
|
+
```{language}
|
|
369
|
+
{code_snippet}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
🤔 Please review this code and provide feedback!
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
*Use `review_code()` to provide feedback*"""
|
|
377
|
+
|
|
378
|
+
metadata = {
|
|
379
|
+
"type": "code_shared",
|
|
380
|
+
"language": language,
|
|
381
|
+
"timestamp": datetime.now().isoformat()
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if target_ai_id:
|
|
385
|
+
metadata["target_ai"] = target_ai_id
|
|
386
|
+
|
|
387
|
+
try:
|
|
388
|
+
await self.client.send_message(
|
|
389
|
+
message_type="message",
|
|
390
|
+
content=content,
|
|
391
|
+
metadata=metadata
|
|
392
|
+
)
|
|
393
|
+
print(f"✅ Code shared ({language})")
|
|
394
|
+
return True
|
|
395
|
+
except Exception as e:
|
|
396
|
+
print(f"❌ Error sharing code: {e}")
|
|
397
|
+
return False
|
|
398
|
+
|
|
399
|
+
async def review_code(self, target_ai_id: int, code_snippet: str, feedback: str, language: str = "python"):
|
|
400
|
+
"""Provide code review feedback"""
|
|
401
|
+
if not self.connected:
|
|
402
|
+
print("❌ Not connected to CloudBrain")
|
|
403
|
+
return False
|
|
404
|
+
|
|
405
|
+
content = f"""🔍 **Code Review**
|
|
406
|
+
|
|
407
|
+
**Reviewer:** {self.ai_name} (AI {self.ai_id})
|
|
408
|
+
**For:** AI {target_ai_id}
|
|
409
|
+
**Language:** {language}
|
|
410
|
+
|
|
411
|
+
💬 **Feedback:**
|
|
412
|
+
{feedback}
|
|
413
|
+
|
|
414
|
+
💻 **Original Code:**
|
|
415
|
+
```{language}
|
|
416
|
+
{code_snippet}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
✨ Hope this helps improve the code!
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
*Use `complete_pair_session()` when review is complete*"""
|
|
424
|
+
|
|
425
|
+
try:
|
|
426
|
+
await self.client.send_message(
|
|
427
|
+
message_type="message",
|
|
428
|
+
content=content,
|
|
429
|
+
metadata={
|
|
430
|
+
"type": "code_review",
|
|
431
|
+
"target_ai": target_ai_id,
|
|
432
|
+
"language": language,
|
|
433
|
+
"timestamp": datetime.now().isoformat()
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
print(f"✅ Code review sent to AI {target_ai_id}")
|
|
437
|
+
return True
|
|
438
|
+
except Exception as e:
|
|
439
|
+
print(f"❌ Error reviewing code: {e}")
|
|
440
|
+
return False
|
|
441
|
+
|
|
442
|
+
async def complete_pair_session(self, partner_ai_id: int, summary: str, lines_added: int = 0, lines_reviewed: int = 0):
|
|
443
|
+
"""Complete a pair programming session with summary"""
|
|
444
|
+
if not self.connected:
|
|
445
|
+
print("❌ Not connected to CloudBrain")
|
|
446
|
+
return False
|
|
447
|
+
|
|
448
|
+
content = f"""✅ **Pair Programming Session Completed**
|
|
449
|
+
|
|
450
|
+
**Participants:** {self.ai_name} (AI {self.ai_id}) + AI {partner_ai_id}
|
|
451
|
+
|
|
452
|
+
📊 **Session Statistics:**
|
|
453
|
+
- Lines Added: {lines_added}
|
|
454
|
+
- Lines Reviewed: {lines_reviewed}
|
|
455
|
+
|
|
456
|
+
📝 **Summary:**
|
|
457
|
+
{summary}
|
|
458
|
+
|
|
459
|
+
🎉 Great collaboration! Let's do it again sometime!
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
*Session closed*"""
|
|
464
|
+
|
|
465
|
+
try:
|
|
466
|
+
await self.client.send_message(
|
|
467
|
+
message_type="message",
|
|
468
|
+
content=content,
|
|
469
|
+
metadata={
|
|
470
|
+
"type": "pair_programming_completed",
|
|
471
|
+
"partner_ai": partner_ai_id,
|
|
472
|
+
"lines_added": lines_added,
|
|
473
|
+
"lines_reviewed": lines_reviewed,
|
|
474
|
+
"timestamp": datetime.now().isoformat()
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
print(f"✅ Pair programming session completed with AI {partner_ai_id}")
|
|
478
|
+
return True
|
|
479
|
+
except Exception as e:
|
|
480
|
+
print(f"❌ Error completing pair session: {e}")
|
|
481
|
+
return False
|
|
482
|
+
|
|
483
|
+
async def request_code_review(self, target_ai_id: int, code_snippet: str, language: str = "python", description: str = ""):
|
|
484
|
+
"""Request code review from another AI"""
|
|
485
|
+
if not self.connected:
|
|
486
|
+
print("❌ Not connected to CloudBrain")
|
|
487
|
+
return False
|
|
488
|
+
|
|
489
|
+
content = f"""🔍 **Code Review Request**
|
|
490
|
+
|
|
491
|
+
**Reviewer Requested:** AI {target_ai_id}
|
|
492
|
+
**From:** {self.ai_name} (AI {self.ai_id})
|
|
493
|
+
**Language:** {language}
|
|
494
|
+
|
|
495
|
+
📝 **Description:**
|
|
496
|
+
{description}
|
|
497
|
+
|
|
498
|
+
💻 **Code to Review:**
|
|
499
|
+
```{language}
|
|
500
|
+
{code_snippet}
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
🤔 Please review this code and provide feedback!
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
*Use `provide_code_review()` to send your feedback*"""
|
|
508
|
+
|
|
509
|
+
try:
|
|
510
|
+
await self.client.send_message(
|
|
511
|
+
message_type="message",
|
|
512
|
+
content=content,
|
|
513
|
+
metadata={
|
|
514
|
+
"type": "code_review_request",
|
|
515
|
+
"target_ai": target_ai_id,
|
|
516
|
+
"language": language,
|
|
517
|
+
"timestamp": datetime.now().isoformat()
|
|
518
|
+
}
|
|
519
|
+
)
|
|
520
|
+
print(f"✅ Code review request sent to AI {target_ai_id}")
|
|
521
|
+
return True
|
|
522
|
+
except Exception as e:
|
|
523
|
+
print(f"❌ Error requesting code review: {e}")
|
|
524
|
+
return False
|
|
525
|
+
|
|
526
|
+
async def provide_code_review(self, target_ai_id: int, code_snippet: str, feedback: str, language: str = "python", rating: int = None):
|
|
527
|
+
"""Provide code review feedback"""
|
|
528
|
+
if not self.connected:
|
|
529
|
+
print("❌ Not connected to CloudBrain")
|
|
530
|
+
return False
|
|
531
|
+
|
|
532
|
+
rating_str = f"⭐ **Rating:** {rating}/5" if rating else ""
|
|
533
|
+
content = f"""🔍 **Code Review Feedback**
|
|
534
|
+
|
|
535
|
+
**Reviewer:** {self.ai_name} (AI {self.ai_id})
|
|
536
|
+
**For:** AI {target_ai_id}
|
|
537
|
+
**Language:** {language}
|
|
538
|
+
{rating_str}
|
|
539
|
+
|
|
540
|
+
💬 **Feedback:**
|
|
541
|
+
{feedback}
|
|
542
|
+
|
|
543
|
+
💻 **Original Code:**
|
|
544
|
+
```{language}
|
|
545
|
+
{code_snippet}
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
✨ Hope this helps improve the code!
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
*Review complete*"""
|
|
553
|
+
|
|
554
|
+
metadata = {
|
|
555
|
+
"type": "code_review_feedback",
|
|
556
|
+
"target_ai": target_ai_id,
|
|
557
|
+
"language": language,
|
|
558
|
+
"timestamp": datetime.now().isoformat()
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if rating:
|
|
562
|
+
metadata["rating"] = rating
|
|
563
|
+
|
|
564
|
+
try:
|
|
565
|
+
await self.client.send_message(
|
|
566
|
+
message_type="message",
|
|
567
|
+
content=content,
|
|
568
|
+
metadata=metadata
|
|
569
|
+
)
|
|
570
|
+
print(f"✅ Code review feedback sent to AI {target_ai_id}")
|
|
571
|
+
return True
|
|
572
|
+
except Exception as e:
|
|
573
|
+
print(f"❌ Error providing code review: {e}")
|
|
574
|
+
return False
|
|
575
|
+
|
|
576
|
+
async def search_knowledge_base(self, query: str, limit: int = 10) -> List[Dict]:
|
|
577
|
+
"""Search knowledge base for information"""
|
|
578
|
+
if not self.connected:
|
|
579
|
+
print("❌ Not connected to CloudBrain")
|
|
580
|
+
return []
|
|
581
|
+
|
|
582
|
+
try:
|
|
583
|
+
response = await self.client.send_request("documentation_search", {
|
|
584
|
+
"query": query,
|
|
585
|
+
"limit": limit
|
|
586
|
+
})
|
|
587
|
+
|
|
588
|
+
if response and response.get('type') == 'documentation_search_results':
|
|
589
|
+
results = response.get('results', [])
|
|
590
|
+
print(f"✅ Found {len(results)} knowledge base entries")
|
|
591
|
+
return results
|
|
592
|
+
|
|
593
|
+
return []
|
|
594
|
+
except Exception as e:
|
|
595
|
+
print(f"❌ Error searching knowledge base: {e}")
|
|
596
|
+
return []
|
|
597
|
+
|
|
598
|
+
async def contribute_to_knowledge_base(self, title: str, content: str, tags: List[str] = None, category: str = "general") -> bool:
|
|
599
|
+
"""Contribute knowledge to the knowledge base"""
|
|
600
|
+
if not self.connected:
|
|
601
|
+
print("❌ Not connected to CloudBrain")
|
|
602
|
+
return False
|
|
603
|
+
|
|
604
|
+
knowledge_content = f"""📚 **Knowledge Base Contribution**
|
|
605
|
+
|
|
606
|
+
**Title:** {title}
|
|
607
|
+
**Contributor:** {self.ai_name} (AI {self.ai_id})
|
|
608
|
+
**Category:** {category}
|
|
609
|
+
|
|
610
|
+
📝 **Content:**
|
|
611
|
+
{content}
|
|
612
|
+
|
|
613
|
+
🏷️ **Tags:** {', '.join(tags) if tags else 'None'}
|
|
614
|
+
|
|
615
|
+
---
|
|
616
|
+
|
|
617
|
+
*Knowledge contributed*"""
|
|
618
|
+
|
|
619
|
+
try:
|
|
620
|
+
await self.client.send_message(
|
|
621
|
+
message_type="documentation",
|
|
622
|
+
content=knowledge_content,
|
|
623
|
+
metadata={
|
|
624
|
+
"type": "knowledge_contribution",
|
|
625
|
+
"title": title,
|
|
626
|
+
"category": category,
|
|
627
|
+
"tags": tags or [],
|
|
628
|
+
"timestamp": datetime.now().isoformat()
|
|
629
|
+
}
|
|
630
|
+
)
|
|
631
|
+
print(f"✅ Knowledge contributed: {title}")
|
|
632
|
+
return True
|
|
633
|
+
except Exception as e:
|
|
634
|
+
print(f"❌ Error contributing knowledge: {e}")
|
|
635
|
+
return False
|
|
636
|
+
|
|
637
|
+
async def delegate_task(self, target_ai_id: int, task_title: str, task_description: str, priority: str = "medium", deadline: str = None) -> bool:
|
|
638
|
+
"""Delegate a task to another AI"""
|
|
639
|
+
if not self.connected:
|
|
640
|
+
print("❌ Not connected to CloudBrain")
|
|
641
|
+
return False
|
|
642
|
+
|
|
643
|
+
deadline_str = f"📅 **Deadline:** {deadline}" if deadline else ""
|
|
644
|
+
content = f"""📋 **Task Delegation**
|
|
645
|
+
|
|
646
|
+
**From:** {self.ai_name} (AI {self.ai_id})
|
|
647
|
+
**To:** AI {target_ai_id}
|
|
648
|
+
**Priority:** {priority.upper()}
|
|
649
|
+
{deadline_str}
|
|
650
|
+
|
|
651
|
+
📝 **Task Title:**
|
|
652
|
+
{task_title}
|
|
653
|
+
|
|
654
|
+
📄 **Task Description:**
|
|
655
|
+
{task_description}
|
|
656
|
+
|
|
657
|
+
🤝 Please accept this task if you can help!
|
|
658
|
+
|
|
659
|
+
---
|
|
660
|
+
|
|
661
|
+
*Use `accept_task()` to accept this delegation*"""
|
|
662
|
+
|
|
663
|
+
metadata = {
|
|
664
|
+
"type": "task_delegation",
|
|
665
|
+
"target_ai": target_ai_id,
|
|
666
|
+
"priority": priority,
|
|
667
|
+
"timestamp": datetime.now().isoformat()
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
if deadline:
|
|
671
|
+
metadata["deadline"] = deadline
|
|
672
|
+
|
|
673
|
+
try:
|
|
674
|
+
await self.client.send_message(
|
|
675
|
+
message_type="message",
|
|
676
|
+
content=content,
|
|
677
|
+
metadata=metadata
|
|
678
|
+
)
|
|
679
|
+
print(f"✅ Task delegated to AI {target_ai_id}: {task_title}")
|
|
680
|
+
return True
|
|
681
|
+
except Exception as e:
|
|
682
|
+
print(f"❌ Error delegating task: {e}")
|
|
683
|
+
return False
|
|
684
|
+
|
|
685
|
+
async def accept_task(self, requester_ai_id: int, task_id: int, message: str = "I accept this task!") -> bool:
|
|
686
|
+
"""Accept a delegated task"""
|
|
687
|
+
if not self.connected:
|
|
688
|
+
print("❌ Not connected to CloudBrain")
|
|
689
|
+
return False
|
|
690
|
+
|
|
691
|
+
content = f"""✅ **Task Accepted**
|
|
692
|
+
|
|
693
|
+
**From:** AI {requester_ai_id}
|
|
694
|
+
**Task ID:** {task_id}
|
|
695
|
+
**Accepted By:** {self.ai_name} (AI {self.ai_id})
|
|
696
|
+
|
|
697
|
+
💬 **Message:**
|
|
698
|
+
{message}
|
|
699
|
+
|
|
700
|
+
🚀 Starting work on this task now!
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
*Task accepted*"""
|
|
705
|
+
|
|
706
|
+
try:
|
|
707
|
+
await self.client.send_message(
|
|
708
|
+
message_type="message",
|
|
709
|
+
content=content,
|
|
710
|
+
metadata={
|
|
711
|
+
"type": "task_accepted",
|
|
712
|
+
"requester_ai": requester_ai_id,
|
|
713
|
+
"task_id": task_id,
|
|
714
|
+
"timestamp": datetime.now().isoformat()
|
|
715
|
+
}
|
|
716
|
+
)
|
|
717
|
+
print(f"✅ Task accepted from AI {requester_ai_id}")
|
|
718
|
+
return True
|
|
719
|
+
except Exception as e:
|
|
720
|
+
print(f"❌ Error accepting task: {e}")
|
|
721
|
+
return False
|
|
722
|
+
|
|
723
|
+
async def complete_task(self, requester_ai_id: int, task_id: int, summary: str, result: str = "") -> bool:
|
|
724
|
+
"""Complete a delegated task"""
|
|
725
|
+
if not self.connected:
|
|
726
|
+
print("❌ Not connected to CloudBrain")
|
|
727
|
+
return False
|
|
728
|
+
|
|
729
|
+
content = f"""✅ **Task Completed**
|
|
730
|
+
|
|
731
|
+
**From:** AI {requester_ai_id}
|
|
732
|
+
**Task ID:** {task_id}
|
|
733
|
+
**Completed By:** {self.ai_name} (AI {self.ai_id})
|
|
734
|
+
|
|
735
|
+
📝 **Summary:**
|
|
736
|
+
{summary}
|
|
737
|
+
|
|
738
|
+
💻 **Result:**
|
|
739
|
+
{result}
|
|
740
|
+
|
|
741
|
+
🎉 Task completed successfully!
|
|
742
|
+
|
|
743
|
+
---
|
|
744
|
+
|
|
745
|
+
*Task closed*"""
|
|
746
|
+
|
|
747
|
+
try:
|
|
748
|
+
await self.client.send_message(
|
|
749
|
+
message_type="message",
|
|
750
|
+
content=content,
|
|
751
|
+
metadata={
|
|
752
|
+
"type": "task_completed",
|
|
753
|
+
"requester_ai": requester_ai_id,
|
|
754
|
+
"task_id": task_id,
|
|
755
|
+
"timestamp": datetime.now().isoformat()
|
|
756
|
+
}
|
|
757
|
+
)
|
|
758
|
+
print(f"✅ Task completed for AI {requester_ai_id}")
|
|
759
|
+
return True
|
|
760
|
+
except Exception as e:
|
|
761
|
+
print(f"❌ Error completing task: {e}")
|
|
762
|
+
return False
|
|
275
763
|
|
|
276
764
|
|
|
277
765
|
class CloudBrainCollaborationHelper:
|
|
@@ -521,6 +1009,54 @@ class CloudBrainCollaborationHelper:
|
|
|
521
1009
|
return response.get('results', [])
|
|
522
1010
|
|
|
523
1011
|
return []
|
|
1012
|
+
|
|
1013
|
+
async def request_pair_programming(self, target_ai_id: int, task_description: str, code_snippet: str = "", language: str = "python"):
|
|
1014
|
+
"""Request pair programming session with another AI"""
|
|
1015
|
+
return await self._collaborator.request_pair_programming(target_ai_id, task_description, code_snippet, language)
|
|
1016
|
+
|
|
1017
|
+
async def accept_pair_programming(self, requester_ai_id: int, message: str = "I'm ready to pair program!"):
|
|
1018
|
+
"""Accept a pair programming request"""
|
|
1019
|
+
return await self._collaborator.accept_pair_programming(requester_ai_id, message)
|
|
1020
|
+
|
|
1021
|
+
async def share_code(self, code_snippet: str, language: str = "python", description: str = "", target_ai_id: int = None):
|
|
1022
|
+
"""Share code snippet during pair programming session"""
|
|
1023
|
+
return await self._collaborator.share_code(code_snippet, language, description, target_ai_id)
|
|
1024
|
+
|
|
1025
|
+
async def review_code(self, target_ai_id: int, code_snippet: str, feedback: str, language: str = "python"):
|
|
1026
|
+
"""Provide code review feedback"""
|
|
1027
|
+
return await self._collaborator.review_code(target_ai_id, code_snippet, feedback, language)
|
|
1028
|
+
|
|
1029
|
+
async def complete_pair_session(self, partner_ai_id: int, summary: str, lines_added: int = 0, lines_reviewed: int = 0):
|
|
1030
|
+
"""Complete a pair programming session with summary"""
|
|
1031
|
+
return await self._collaborator.complete_pair_session(partner_ai_id, summary, lines_added, lines_reviewed)
|
|
1032
|
+
|
|
1033
|
+
async def request_code_review(self, target_ai_id: int, code_snippet: str, language: str = "python", description: str = ""):
|
|
1034
|
+
"""Request code review from another AI"""
|
|
1035
|
+
return await self._collaborator.request_code_review(target_ai_id, code_snippet, language, description)
|
|
1036
|
+
|
|
1037
|
+
async def provide_code_review(self, target_ai_id: int, code_snippet: str, feedback: str, language: str = "python", rating: int = None):
|
|
1038
|
+
"""Provide code review feedback"""
|
|
1039
|
+
return await self._collaborator.provide_code_review(target_ai_id, code_snippet, feedback, language, rating)
|
|
1040
|
+
|
|
1041
|
+
async def search_knowledge_base(self, query: str, limit: int = 10) -> List[Dict]:
|
|
1042
|
+
"""Search the knowledge base for information"""
|
|
1043
|
+
return await self._collaborator.search_knowledge_base(query, limit)
|
|
1044
|
+
|
|
1045
|
+
async def contribute_to_knowledge_base(self, title: str, content: str, tags: List[str] = None, category: str = "general") -> bool:
|
|
1046
|
+
"""Contribute knowledge to the knowledge base"""
|
|
1047
|
+
return await self._collaborator.contribute_to_knowledge_base(title, content, tags, category)
|
|
1048
|
+
|
|
1049
|
+
async def delegate_task(self, target_ai_id: int, task_title: str, task_description: str, priority: str = "medium", deadline: str = None) -> bool:
|
|
1050
|
+
"""Delegate a task to another AI"""
|
|
1051
|
+
return await self._collaborator.delegate_task(target_ai_id, task_title, task_description, priority, deadline)
|
|
1052
|
+
|
|
1053
|
+
async def accept_task(self, requester_ai_id: int, task_id: int, message: str = "I accept this task!") -> bool:
|
|
1054
|
+
"""Accept a delegated task"""
|
|
1055
|
+
return await self._collaborator.accept_task(requester_ai_id, task_id, message)
|
|
1056
|
+
|
|
1057
|
+
async def complete_task(self, requester_ai_id: int, task_id: int, summary: str, result: str = "") -> bool:
|
|
1058
|
+
"""Complete a delegated task"""
|
|
1059
|
+
return await self._collaborator.complete_task(requester_ai_id, task_id, summary, result)
|
|
524
1060
|
|
|
525
1061
|
|
|
526
1062
|
async def integrate_cloudbrain_to_tasks(ai_id: int, tasks: List[Dict[str, str]]) -> bool:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cloudbrain-client
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: CloudBrain Client - AI collaboration and communication system with AI-to-AI collaboration support, documentation access, democratic server authorization, and message receiving capabilities
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: CloudBrain Client - AI collaboration and communication system with AI-to-AI collaboration support, pair programming, code reviews, knowledge base, task delegation, documentation access, democratic server authorization, and message receiving capabilities
|
|
5
5
|
Author: CloudBrain Team
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/cloudbrain-project/cloudbrain
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cloudbrain-client"
|
|
7
|
-
version = "1.
|
|
8
|
-
description = "CloudBrain Client - AI collaboration and communication system with AI-to-AI collaboration support, documentation access, democratic server authorization, and message receiving capabilities"
|
|
7
|
+
version = "1.3.0"
|
|
8
|
+
description = "CloudBrain Client - AI collaboration and communication system with AI-to-AI collaboration support, pair programming, code reviews, knowledge base, task delegation, documentation access, democratic server authorization, and message receiving capabilities"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
11
11
|
license = {text = "MIT"}
|
|
@@ -50,4 +50,4 @@ cloudbrain-quick = "cloudbrain_client.cloudbrain_quick:main"
|
|
|
50
50
|
packages = ["cloudbrain_client"]
|
|
51
51
|
|
|
52
52
|
[tool.setuptools.package-data]
|
|
53
|
-
cloudbrain_client = ["*.md"]
|
|
53
|
+
cloudbrain_client = ["*.md"]
|
|
File without changes
|
|
File without changes
|
{cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/ai_conversation_helper.py
RENAMED
|
File without changes
|
{cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client/ai_websocket_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{cloudbrain_client-1.2.0 → cloudbrain_client-1.3.0}/cloudbrain_client.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|