monoco-toolkit 0.3.6__py3-none-any.whl → 0.3.9__py3-none-any.whl

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 (58) hide show
  1. monoco/cli/workspace.py +1 -1
  2. monoco/core/config.py +51 -0
  3. monoco/core/hooks/__init__.py +19 -0
  4. monoco/core/hooks/base.py +104 -0
  5. monoco/core/hooks/builtin/__init__.py +11 -0
  6. monoco/core/hooks/builtin/git_cleanup.py +266 -0
  7. monoco/core/hooks/builtin/logging_hook.py +78 -0
  8. monoco/core/hooks/context.py +131 -0
  9. monoco/core/hooks/registry.py +222 -0
  10. monoco/core/integrations.py +6 -0
  11. monoco/core/registry.py +2 -0
  12. monoco/core/setup.py +1 -1
  13. monoco/core/skills.py +226 -42
  14. monoco/features/{scheduler → agent}/__init__.py +4 -2
  15. monoco/features/{scheduler → agent}/cli.py +134 -80
  16. monoco/features/{scheduler → agent}/config.py +17 -3
  17. monoco/features/agent/defaults.py +55 -0
  18. monoco/features/agent/flow_skills.py +281 -0
  19. monoco/features/{scheduler → agent}/manager.py +39 -2
  20. monoco/features/{scheduler → agent}/models.py +6 -3
  21. monoco/features/{scheduler → agent}/reliability.py +1 -1
  22. monoco/features/agent/resources/skills/flow_engineer/SKILL.md +94 -0
  23. monoco/features/agent/resources/skills/flow_manager/SKILL.md +88 -0
  24. monoco/features/agent/resources/skills/flow_reviewer/SKILL.md +114 -0
  25. monoco/features/{scheduler → agent}/session.py +36 -1
  26. monoco/features/{scheduler → agent}/worker.py +2 -2
  27. monoco/features/i18n/resources/skills/i18n_scan_workflow/SKILL.md +105 -0
  28. monoco/features/issue/commands.py +427 -21
  29. monoco/features/issue/core.py +100 -0
  30. monoco/features/issue/criticality.py +553 -0
  31. monoco/features/issue/domain/models.py +28 -2
  32. monoco/features/issue/engine/machine.py +70 -13
  33. monoco/features/issue/git_service.py +185 -0
  34. monoco/features/issue/linter.py +291 -62
  35. monoco/features/issue/models.py +49 -2
  36. monoco/features/issue/resources/en/SKILL.md +48 -0
  37. monoco/features/issue/resources/skills/issue_lifecycle_workflow/SKILL.md +159 -0
  38. monoco/features/issue/resources/zh/SKILL.md +50 -0
  39. monoco/features/issue/validator.py +185 -65
  40. monoco/features/memo/__init__.py +2 -1
  41. monoco/features/memo/adapter.py +32 -0
  42. monoco/features/memo/cli.py +36 -14
  43. monoco/features/memo/core.py +59 -0
  44. monoco/features/memo/resources/skills/note_processing_workflow/SKILL.md +140 -0
  45. monoco/features/memo/resources/zh/AGENTS.md +8 -0
  46. monoco/features/memo/resources/zh/SKILL.md +75 -0
  47. monoco/features/spike/resources/skills/research_workflow/SKILL.md +121 -0
  48. monoco/main.py +2 -3
  49. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.9.dist-info}/METADATA +1 -1
  50. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.9.dist-info}/RECORD +55 -37
  51. monoco/features/scheduler/defaults.py +0 -54
  52. monoco/features/skills/__init__.py +0 -0
  53. monoco/features/skills/core.py +0 -102
  54. /monoco/core/{hooks.py → githooks.py} +0 -0
  55. /monoco/features/{scheduler → agent}/engines.py +0 -0
  56. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.9.dist-info}/WHEEL +0 -0
  57. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.9.dist-info}/entry_points.txt +0 -0
  58. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.9.dist-info}/licenses/LICENSE +0 -0
@@ -1,102 +0,0 @@
1
- import re
2
- from pathlib import Path
3
- from typing import Dict, List, Any
4
- from rich.console import Console
5
-
6
- console = Console()
7
-
8
-
9
- def init(root: Path, resources: List[Dict[str, Any]]):
10
- """
11
- Initialize the Skills module.
12
-
13
- Args:
14
- root: Project root directory.
15
- resources: List of resource dicts from modules.
16
- Expected format:
17
- {
18
- "skills": { "name": "content" },
19
- "prompts": { "name": "content" }
20
- }
21
- """
22
- skills_root = root / "Toolkit" / "skills"
23
- skills_root.mkdir(parents=True, exist_ok=True)
24
-
25
- # 1. Write Skills
26
- for res in resources:
27
- if "skills" in res:
28
- for name, content in res["skills"].items():
29
- target_dir = skills_root / name
30
- target_dir.mkdir(exist_ok=True)
31
- target_file = target_dir / "SKILL.md"
32
- # Idempotency: Overwrite if content is different? Or just always overwrite?
33
- # User asked for "scaffold", implies creation.
34
- # Let's overwrite to ensure extensive "Repair" capability.
35
- target_file.write_text(content, encoding="utf-8")
36
- console.print(f"[dim] - Scaffolding skill:[/dim] {name}")
37
-
38
- # 2. Update Agent Docs
39
- update_agent_docs(root, resources)
40
-
41
-
42
- def update_agent_docs(root: Path, resources: List[Dict[str, Any]]):
43
- """
44
- Inject prompts into AGENTS.md, GEMINI.md, CLAUDE.md.
45
- """
46
- target_files = ["AGENTS.md", "GEMINI.md", "CLAUDE.md"]
47
-
48
- # Aggregate Prompts
49
- aggregated_prompt = "\n\n".join(
50
- [
51
- res["prompts"][name]
52
- for res in resources
53
- if "prompts" in res
54
- for name in res["prompts"]
55
- ]
56
- )
57
-
58
- injection_content = f"""
59
- ## Monoco Toolkit
60
-
61
- The following tools and skills are available in this environment.
62
-
63
- {aggregated_prompt}
64
- """
65
-
66
- for filename in target_files:
67
- _inject_section(root / filename, injection_content)
68
-
69
-
70
- def _inject_section(file_path: Path, content: str):
71
- if not file_path.exists():
72
- # Create if not exists? User said "Edit AGENTS.md...", implies existence.
73
- # But if we init in a fresh repo, maybe we should create them?
74
- # Let's create if missing.
75
- file_path.write_text(f"# Project Guidelines\n{content}", encoding="utf-8")
76
- console.print(f"[green]✔[/green] Created {file_path.name}")
77
- return
78
-
79
- original_content = file_path.read_text(encoding="utf-8")
80
-
81
- # Regex to find existing section
82
- # Matches ## Monoco Toolkit ... until next ## or End of String
83
- pattern = r"(## Monoco Toolkit.*?)(\n## |\Z)"
84
-
85
- # Check if section exists
86
- if re.search(pattern, original_content, re.DOTALL):
87
- # Replace
88
- new_content = re.sub(
89
- pattern, f"{content.strip()}\n\n\\2", original_content, flags=re.DOTALL
90
- )
91
- if new_content != original_content:
92
- file_path.write_text(new_content, encoding="utf-8")
93
- console.print(f"[green]✔[/green] Updated {file_path.name}")
94
- else:
95
- console.print(f"[dim] - {file_path.name} is up to date.[/dim]")
96
- else:
97
- # Append
98
- with open(file_path, "a", encoding="utf-8") as f:
99
- if not original_content.endswith("\n"):
100
- f.write("\n")
101
- f.write(content)
102
- console.print(f"[green]✔[/green] Appended to {file_path.name}")
File without changes
File without changes