monoco-toolkit 0.3.6__py3-none-any.whl → 0.3.10__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 (113) hide show
  1. monoco/cli/workspace.py +1 -1
  2. monoco/core/config.py +58 -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/injection.py +63 -29
  11. monoco/core/integrations.py +8 -2
  12. monoco/core/output.py +5 -5
  13. monoco/core/registry.py +9 -1
  14. monoco/core/resource/__init__.py +5 -0
  15. monoco/core/resource/finder.py +98 -0
  16. monoco/core/resource/manager.py +91 -0
  17. monoco/core/resource/models.py +35 -0
  18. monoco/core/resources/en/{SKILL.md → skills/monoco_core/SKILL.md} +2 -0
  19. monoco/core/resources/zh/{SKILL.md → skills/monoco_core/SKILL.md} +2 -0
  20. monoco/core/setup.py +1 -1
  21. monoco/core/skill_framework.py +292 -0
  22. monoco/core/skills.py +538 -254
  23. monoco/core/sync.py +73 -1
  24. monoco/core/workflow_converter.py +420 -0
  25. monoco/features/{scheduler → agent}/__init__.py +5 -3
  26. monoco/features/agent/adapter.py +31 -0
  27. monoco/features/agent/apoptosis.py +44 -0
  28. monoco/features/agent/cli.py +296 -0
  29. monoco/features/agent/config.py +96 -0
  30. monoco/features/agent/defaults.py +12 -0
  31. monoco/features/{scheduler → agent}/engines.py +32 -6
  32. monoco/features/agent/flow_skills.py +281 -0
  33. monoco/features/agent/manager.py +91 -0
  34. monoco/features/{scheduler → agent}/models.py +6 -3
  35. monoco/features/agent/resources/atoms/atom-code-dev.yaml +61 -0
  36. monoco/features/agent/resources/atoms/atom-issue-lifecycle.yaml +73 -0
  37. monoco/features/agent/resources/atoms/atom-knowledge.yaml +55 -0
  38. monoco/features/agent/resources/atoms/atom-review.yaml +60 -0
  39. monoco/features/agent/resources/en/skills/flow_engineer/SKILL.md +94 -0
  40. monoco/features/agent/resources/en/skills/flow_manager/SKILL.md +93 -0
  41. monoco/features/agent/resources/en/skills/flow_planner/SKILL.md +85 -0
  42. monoco/features/agent/resources/en/skills/flow_reviewer/SKILL.md +114 -0
  43. monoco/features/agent/resources/roles/role-engineer.yaml +49 -0
  44. monoco/features/agent/resources/roles/role-manager.yaml +46 -0
  45. monoco/features/agent/resources/roles/role-planner.yaml +46 -0
  46. monoco/features/agent/resources/roles/role-reviewer.yaml +47 -0
  47. monoco/features/agent/resources/workflows/workflow-dev.yaml +83 -0
  48. monoco/features/agent/resources/workflows/workflow-issue-create.yaml +72 -0
  49. monoco/features/agent/resources/workflows/workflow-review.yaml +94 -0
  50. monoco/features/agent/resources/zh/skills/flow_engineer/SKILL.md +94 -0
  51. monoco/features/agent/resources/zh/skills/flow_manager/SKILL.md +88 -0
  52. monoco/features/agent/resources/zh/skills/flow_planner/SKILL.md +259 -0
  53. monoco/features/agent/resources/zh/skills/flow_reviewer/SKILL.md +137 -0
  54. monoco/features/{scheduler → agent}/session.py +36 -1
  55. monoco/features/{scheduler → agent}/worker.py +40 -4
  56. monoco/features/glossary/adapter.py +31 -0
  57. monoco/features/glossary/config.py +5 -0
  58. monoco/features/glossary/resources/en/AGENTS.md +29 -0
  59. monoco/features/glossary/resources/en/skills/monoco_glossary/SKILL.md +35 -0
  60. monoco/features/glossary/resources/zh/AGENTS.md +29 -0
  61. monoco/features/glossary/resources/zh/skills/monoco_glossary/SKILL.md +35 -0
  62. monoco/features/i18n/resources/en/skills/i18n_scan_workflow/SKILL.md +105 -0
  63. monoco/features/i18n/resources/en/{SKILL.md → skills/monoco_i18n/SKILL.md} +2 -0
  64. monoco/features/i18n/resources/zh/skills/i18n_scan_workflow/SKILL.md +105 -0
  65. monoco/features/i18n/resources/zh/{SKILL.md → skills/monoco_i18n/SKILL.md} +2 -0
  66. monoco/features/issue/commands.py +427 -21
  67. monoco/features/issue/core.py +140 -1
  68. monoco/features/issue/criticality.py +553 -0
  69. monoco/features/issue/domain/models.py +28 -2
  70. monoco/features/issue/engine/machine.py +75 -15
  71. monoco/features/issue/git_service.py +185 -0
  72. monoco/features/issue/linter.py +291 -62
  73. monoco/features/issue/models.py +50 -2
  74. monoco/features/issue/resources/en/skills/issue_create_workflow/SKILL.md +167 -0
  75. monoco/features/issue/resources/en/skills/issue_develop_workflow/SKILL.md +224 -0
  76. monoco/features/issue/resources/en/skills/issue_lifecycle_workflow/SKILL.md +159 -0
  77. monoco/features/issue/resources/en/skills/issue_refine_workflow/SKILL.md +203 -0
  78. monoco/features/issue/resources/en/{SKILL.md → skills/monoco_issue/SKILL.md} +50 -0
  79. monoco/features/issue/resources/zh/skills/issue_create_workflow/SKILL.md +167 -0
  80. monoco/features/issue/resources/zh/skills/issue_develop_workflow/SKILL.md +224 -0
  81. monoco/features/issue/resources/zh/skills/issue_lifecycle_workflow/SKILL.md +159 -0
  82. monoco/features/issue/resources/zh/skills/issue_refine_workflow/SKILL.md +203 -0
  83. monoco/features/issue/resources/zh/{SKILL.md → skills/monoco_issue/SKILL.md} +52 -0
  84. monoco/features/issue/validator.py +185 -65
  85. monoco/features/memo/__init__.py +2 -1
  86. monoco/features/memo/adapter.py +32 -0
  87. monoco/features/memo/cli.py +36 -14
  88. monoco/features/memo/core.py +59 -0
  89. monoco/features/memo/resources/en/skills/monoco_memo/SKILL.md +77 -0
  90. monoco/features/memo/resources/en/skills/note_processing_workflow/SKILL.md +140 -0
  91. monoco/features/memo/resources/zh/AGENTS.md +8 -0
  92. monoco/features/memo/resources/zh/skills/monoco_memo/SKILL.md +77 -0
  93. monoco/features/memo/resources/zh/skills/note_processing_workflow/SKILL.md +140 -0
  94. monoco/features/spike/resources/en/{SKILL.md → skills/monoco_spike/SKILL.md} +2 -0
  95. monoco/features/spike/resources/en/skills/research_workflow/SKILL.md +121 -0
  96. monoco/features/spike/resources/zh/{SKILL.md → skills/monoco_spike/SKILL.md} +2 -0
  97. monoco/features/spike/resources/zh/skills/research_workflow/SKILL.md +121 -0
  98. monoco/main.py +2 -3
  99. monoco_toolkit-0.3.10.dist-info/METADATA +124 -0
  100. monoco_toolkit-0.3.10.dist-info/RECORD +156 -0
  101. monoco/features/scheduler/cli.py +0 -285
  102. monoco/features/scheduler/config.py +0 -68
  103. monoco/features/scheduler/defaults.py +0 -54
  104. monoco/features/scheduler/manager.py +0 -49
  105. monoco/features/scheduler/reliability.py +0 -106
  106. monoco/features/skills/core.py +0 -102
  107. monoco_toolkit-0.3.6.dist-info/METADATA +0 -127
  108. monoco_toolkit-0.3.6.dist-info/RECORD +0 -97
  109. /monoco/core/{hooks.py → githooks.py} +0 -0
  110. /monoco/features/{skills → glossary}/__init__.py +0 -0
  111. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.10.dist-info}/WHEEL +0 -0
  112. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.10.dist-info}/entry_points.txt +0 -0
  113. {monoco_toolkit-0.3.6.dist-info → monoco_toolkit-0.3.10.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: monoco-toolkit
3
+ Version: 0.3.10
4
+ Summary: Agent Native Toolkit for Monoco - Task Management & Kanban for AI Agents
5
+ Project-URL: Homepage, https://monoco.io
6
+ Project-URL: Repository, https://github.com/IndenScale/Monoco
7
+ Project-URL: Documentation, https://monoco.io/docs
8
+ Project-URL: Issues, https://github.com/IndenScale/Monoco/issues
9
+ Author-email: Monoco Team <dev@monoco.io>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: agent-native,ai-agents,cli,kanban,monoco,task-management,workflow
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Office/Business :: Groupware
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: fastapi>=0.100.0
25
+ Requires-Dist: httpx>=0.28.1
26
+ Requires-Dist: prompt-toolkit>=3.0.0
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Requires-Dist: pyyaml>=6.0
29
+ Requires-Dist: rich>=13.0.0
30
+ Requires-Dist: sse-starlette>=1.6.0
31
+ Requires-Dist: typer[all]>=0.9.0
32
+ Requires-Dist: uvicorn[standard]>=0.20.0
33
+ Requires-Dist: watchdog>=6.0.0
34
+ Description-Content-Type: text/markdown
35
+
36
+ # Monoco Distro
37
+
38
+ [![Version](https://img.shields.io/pypi/v/monoco-toolkit)](https://pypi.org/project/monoco-toolkit/)
39
+ [![License](https://img.shields.io/github/license/IndenScale/Monoco)](LICENSE)
40
+
41
+ > **The Headless Operating System for Agentic Engineering.**
42
+ >
43
+ > Monoco is a **Linux-like Distribution** for AI Agents.
44
+ > It provides the **Package Manager**, **Init System**, and **Policy Kit** that turns a raw LLM Kernel into a production-ready engineering workforce.
45
+
46
+ ---
47
+
48
+ ## 🐧 The "Distro" Metaphor
49
+
50
+ Monoco is built on a clear separation of concerns, inspired by the Linux ecosystem:
51
+
52
+ | Component | In Linux | In Monoco | Responsibility |
53
+ | :---------- | :------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------- |
54
+ | **Kernel** | Linux Kernel | **Kimi CLI / Kosong** | The raw execution engine. Handles LLM prompts, tool execution, and process isolation. |
55
+ | **Distro** | Ubuntu / Arch | **Monoco** | The system manager. Orchestrates workflows, enforces policies, manages state (Issues), and installs capabilities (Skills). |
56
+ | **Desktop** | GNOME / KDE | **VSCode / Zed** | The user interface. Connects to Monoco via standard protocols (LSP, ACP) to provide a visual experience. |
57
+
58
+ ## 🌟 Core Philosophy
59
+
60
+ ### 1. Headless & Protocol-First
61
+
62
+ Monoco is designed to run silently in the background. It doesn't fight for your attention with a chat window. Instead, it exposes its state via **LSP (Language Server Protocol)** and **ACP (Agent Client Protocol)**, allowing your favorite IDEs to become "Agent-Native".
63
+
64
+ ### 2. Issue is the Unit of Work
65
+
66
+ Just as `systemd` manages Units, Monoco manages **Issues**.
67
+ An Issue is not just a text file; it is a stateful object that defines the lifecycle of a task. The Agent cannot "freelance"—it must be assigned to an active Issue.
68
+
69
+ ### 3. Governance as Code
70
+
71
+ Monoco acts as the "Policy Kit" for your AI workforce.
72
+
73
+ - **Guardrails**: Prevent destructive actions.
74
+ - **Verification**: Enforce linting and tests before submission.
75
+ - **Audit**: Log every decision and tool call.
76
+
77
+ ## 🚀 Quick Start
78
+
79
+ ### 1. Installation
80
+
81
+ Install the Monoco Distro via pip:
82
+
83
+ ```bash
84
+ pip install monoco-toolkit
85
+ ```
86
+
87
+ ### 2. Initialize System
88
+
89
+ Turn your project into a Monoco-managed workspace:
90
+
91
+ ```bash
92
+ monoco init
93
+ ```
94
+
95
+ ### 3. Sync Kernel
96
+
97
+ Inject Monoco's policies into your Agent Kernel (e.g., Kimi CLI configuration):
98
+
99
+ ```bash
100
+ monoco sync
101
+ ```
102
+
103
+ ### 4. Start a Session
104
+
105
+ Launch the Monoco Daemon to begin orchestrating work:
106
+
107
+ ```bash
108
+ monoco session start
109
+ ```
110
+
111
+ ## 🛠️ Tech Stack & Architecture
112
+
113
+ - **Kernel Interface**: Python (Interfacing with Kimi/Kosong)
114
+ - **Distro Logic**: Python (State Management, Issue Tracking)
115
+ - **Protocols**: LSP / ACP (for IDE integration)
116
+ - **Storage**: Local Filesystem (Markdown/YAML)
117
+
118
+ ## 🤝 Contributing
119
+
120
+ Monoco is open-source. We are building the standard distribution for the Agentic era.
121
+
122
+ ## 📄 License
123
+
124
+ MIT © [IndenScale](https://github.com/IndenScale)
@@ -0,0 +1,156 @@
1
+ monoco/main.py,sha256=JVrKvrd2U6lOJBu9O6bSvgsUXCPU6_8AFV_vgjiB8Iw,5616
2
+ monoco/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ monoco/cli/project.py,sha256=FqLaDD3hiWxa0_TKzxEF7PYH9RPsvmLyjO3NYVckgGs,2737
4
+ monoco/cli/workspace.py,sha256=vcUHjSarRZk8k3SNjtLSVD2VUPhBIUyx5J1OPtGa7-Q,1541
5
+ monoco/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ monoco/core/config.py,sha256=6UwKl_8ceJ4pt_DYcaZqfVmDYBZRd1wMajQOoyYQMLk,15566
7
+ monoco/core/execution.py,sha256=7522s7uVWiNdMKtWlIb8JHzbAcJgLVuxUFp_6VmhWNQ,1801
8
+ monoco/core/feature.py,sha256=bcK0C1CaQgNLcdMF0RuniaaQRCYSA-0JdOpQz9W_1xM,1968
9
+ monoco/core/git.py,sha256=d3A8L30nlEj0F1pwSHk_cOoRYi1dMCiZc7KD70ViMyw,8335
10
+ monoco/core/githooks.py,sha256=QY4c74LIYDtcjtWYax1PrK5CtVNKYTfVVVBOj-SCulo,1826
11
+ monoco/core/injection.py,sha256=BCMbppPqBH_1XVT7is0UgemstSDnb98E1Df1sdE6JKY,8391
12
+ monoco/core/integrations.py,sha256=V_PgRfJt1X9rAuq0EkILaJufqbwqilyBQmH2-RV4D3U,7917
13
+ monoco/core/lsp.py,sha256=GOrHzubkMWS3iBpP4H2fTFW-0JXa6D2YlU0ZEhp5zmY,2018
14
+ monoco/core/output.py,sha256=21KoFtAiPm_8hwZlNNvuxDUMRNGfoS2_H-rpwTnjxLY,3972
15
+ monoco/core/registry.py,sha256=fEtZPzfHJGiKZTddKQQLtVwHrf-JuADOMPCs0Z1Ygfc,1471
16
+ monoco/core/setup.py,sha256=CYADZjUF1tNu6OQ5oVZ_3X_HN7TxnyrvOWbQwluIA_E,11490
17
+ monoco/core/skill_framework.py,sha256=0EaFDigPNpY9ZO-8tqLTjp9MjsPc1CPum9ir5M862BU,13295
18
+ monoco/core/skills.py,sha256=Xy_Pju1ubUG5ncCKShIe5B6sj_Cj7avhrbpoW9SmwC0,27441
19
+ monoco/core/state.py,sha256=dfoTH1Sj_TSjtTEXuv4w0ZOp_Fd30XNymVSZo30Xshg,1820
20
+ monoco/core/sync.py,sha256=bR8OW0c-l8NLUmxmIClighIV-6Nms9iv9a9Jc3wDKbs,11170
21
+ monoco/core/telemetry.py,sha256=GQDbtgrZwAL1ZpjgbJZuawbTyH6J0NjMXMi4ogq-Ang,2915
22
+ monoco/core/workflow_converter.py,sha256=djAJJKi9iDHscluN7DTMDc6SDEz9YvJSYQW3XLFIbgo,13777
23
+ monoco/core/workspace.py,sha256=H_PHD5A0HZFq841u1JtLoFjkXdQg9D6x6I7QcFtJge4,3000
24
+ monoco/core/hooks/__init__.py,sha256=8dWjDSwJG9JdghWBxgk7zH1U1FlJCiRo66mfbWcDK3M,437
25
+ monoco/core/hooks/base.py,sha256=GQ59E_VX8RmtWezyg5sMFqmKRDsD7PJflcAb2TTy8S8,3276
26
+ monoco/core/hooks/context.py,sha256=A0xwwU6JcsBH3t4h9jlodAdEMuajU8QeW_3bSMTWfPY,4005
27
+ monoco/core/hooks/registry.py,sha256=O_IO1c7R9NbHk3F-xtLowQQkzPBs6qM1Xii398ZfbNU,7100
28
+ monoco/core/hooks/builtin/__init__.py,sha256=R_e04bOLnBKy7pX5QVBkDjgUNeQ82o1IHq--CKgIX_I,177
29
+ monoco/core/hooks/builtin/git_cleanup.py,sha256=crtUv2RJoeo1qOAgLulr6Q0_M-oFTLDNq3Uku1pl3QU,9701
30
+ monoco/core/hooks/builtin/logging_hook.py,sha256=F5iN3zeczEeoumK0nUXf6ZVrO4_5gcA9dne8y4KSiXo,2796
31
+ monoco/core/resource/__init__.py,sha256=CZvZHdtyfgrAehCjoAUuVAJ-XGaLqN7DcGE2SEKHIiU,200
32
+ monoco/core/resource/finder.py,sha256=izX-jTw0juajXbcAuk7MtCXD7Os0pzLXBgTxL-nxwe0,4329
33
+ monoco/core/resource/manager.py,sha256=ZRDyvZFvcFPhD9jzmE3jYbZHCIRkheqcR6INxTke6_Y,3484
34
+ monoco/core/resource/models.py,sha256=mJffVMZ8PpWety-yHhierfmgPst_e1mRqgLWfrUrk4g,934
35
+ monoco/core/resources/en/AGENTS.md,sha256=vf9z43UU-LPwYKPWCrtw8TpWrmkeZ6zfMyHP4Q9JqdQ,1178
36
+ monoco/core/resources/en/skills/monoco_core/SKILL.md,sha256=ZhU_VEkaqkaDAMbAClLzAM1owwZ6lKbRVcQen72diAg,3534
37
+ monoco/core/resources/zh/AGENTS.md,sha256=KBNZSCPBIals6jDdvG5wJgjZuswi_1nKljggJSMtfy8,1156
38
+ monoco/core/resources/zh/skills/monoco_core/SKILL.md,sha256=E7-6Rmg49eqAjwPf16Deu9-RmYIRduaZ1tqEu0WkI8g,3183
39
+ monoco/daemon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
+ monoco/daemon/app.py,sha256=tAtLxzw_aRzU0r6Bk9lhshaCyqZRkQKUJmg5FDi7-1c,15431
41
+ monoco/daemon/commands.py,sha256=2AGsqDZ0edg34KuAGZrTvKlJZ1fhxNXgus7vGn2km4c,1115
42
+ monoco/daemon/models.py,sha256=E-qwebvD-Z-VixFEl067ZDENGmAVOjrin9XV6HLSI5k,988
43
+ monoco/daemon/reproduce_stats.py,sha256=LghJ8o1jTeDpA1zVPI2vF0okGU3h4esEI1thNa6shKI,1196
44
+ monoco/daemon/services.py,sha256=jkkDwX5mBRiy4DZPNxWmHNe_EE-hiX53FoIlWGiCBoM,5070
45
+ monoco/daemon/stats.py,sha256=XTtuFWx68O1OA44SmN0BGVa6sswts2ExmkiavUzCYiA,4800
46
+ monoco/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
+ monoco/features/agent/__init__.py,sha256=nZ8DXHy0F6jvU6jvUUfKmLXxojYuErtmjCniY832qLQ,576
48
+ monoco/features/agent/adapter.py,sha256=6LgJ5tbkr_qYKXktQa-AGUWnXKQRTG31OnOlW0Lcacw,1060
49
+ monoco/features/agent/apoptosis.py,sha256=iQHrPLIiW73_W3MqiiEJyW84BRzq1O7Uc69uD44fvp0,1428
50
+ monoco/features/agent/cli.py,sha256=HorUNabexlsVipVs4iizt8z0S5hPT_z8J6lcoYrDt8Y,9670
51
+ monoco/features/agent/config.py,sha256=nBjwZsod8DI5O4MdD_N9TED87V8dxpK8m-KJAzAsc8c,3296
52
+ monoco/features/agent/defaults.py,sha256=lw3-UIE6ZA8yR5iqczBKYtwu06pHRuuDOy4GPnmDWwU,390
53
+ monoco/features/agent/engines.py,sha256=d4D50kN-n31eiCpUdNfTAFfwI2SIT0YaZ6xg_s0YJfQ,4643
54
+ monoco/features/agent/flow_skills.py,sha256=9YQZvhebS_J2oERsGMfWd6WjDKkAWGzlJ0guIrYgsMw,9079
55
+ monoco/features/agent/manager.py,sha256=dBbPRpz-ZkAqlHPeZAv5c_uIcO-VhD2zBHeKoylU0Vo,3197
56
+ monoco/features/agent/models.py,sha256=WP1i0slVdJxQfGmmxabKOLGU5qc75QXJFvkin-5sxw0,856
57
+ monoco/features/agent/session.py,sha256=ILW0JGY6Nsi_-PqS25z63LqhuczEyZyleAbXfqEtZRo,4388
58
+ monoco/features/agent/worker.py,sha256=wCJZQCJQ6ssQmXBb6TOttZamRRnXocjUla9r5w9wy50,5742
59
+ monoco/features/agent/resources/atoms/atom-code-dev.yaml,sha256=a4zbewWZ4bKNdA8tIIKdXt-s5Gd_M2_IU25qLpDkPlk,1790
60
+ monoco/features/agent/resources/atoms/atom-issue-lifecycle.yaml,sha256=OEDzvMqTB3CtI8ci_z6I-ZapxD6XkJFhXIAPNpQdQac,2417
61
+ monoco/features/agent/resources/atoms/atom-knowledge.yaml,sha256=hTkbUzycgtXPBGpAoVcHIi_P7WVson6zu9Kp79iU5HU,1735
62
+ monoco/features/agent/resources/atoms/atom-review.yaml,sha256=8pk4ieipw63xItlIbCFqAvUUDMUNGIJX7BjvCMJ-rkI,1965
63
+ monoco/features/agent/resources/en/skills/flow_engineer/SKILL.md,sha256=MDpW9a4VQF_LuOp_3Xhi1SFdzZoT2m78-cT9XTku5Uw,2871
64
+ monoco/features/agent/resources/en/skills/flow_manager/SKILL.md,sha256=r5I-ZVoVp2Xgh2Z0Z0bNTWuZM7RCgc-xvrBS32c8Ww8,2848
65
+ monoco/features/agent/resources/en/skills/flow_planner/SKILL.md,sha256=sfN3ZYNo3XdquIhsogfYgaGFTlrls2WZe1GHaZNMhp4,2771
66
+ monoco/features/agent/resources/en/skills/flow_reviewer/SKILL.md,sha256=GwOBjhUlOoaFaFZ4Nca6bly5F9xNkq9kIK8W_BWITT8,2907
67
+ monoco/features/agent/resources/roles/role-engineer.yaml,sha256=X2KB_s6xS6s4-G4ngnx7qbQxcTNmus_9kG5baGtD2q0,1658
68
+ monoco/features/agent/resources/roles/role-manager.yaml,sha256=XVUHIHcRSriTnecnYXjGUFMjqIcjuaWPH5LhGC5GoG0,1497
69
+ monoco/features/agent/resources/roles/role-planner.yaml,sha256=JVvrExc_eY1ILh7VJQ889lasWQ935mJpj3qdGY3vXys,1447
70
+ monoco/features/agent/resources/roles/role-reviewer.yaml,sha256=_PnOcUZqF2yd8hPrf0KY8pfhVNnRV6yQNqCcQRgKFAI,1599
71
+ monoco/features/agent/resources/workflows/workflow-dev.yaml,sha256=ncj9wwsr34hBfWdsUmrSso3VwQ5KmmaOOgVl4kv97JE,2297
72
+ monoco/features/agent/resources/workflows/workflow-issue-create.yaml,sha256=WeOj_R38HU3_5ZSCR2I4GEHZA86CrRCkNMn2tGum5nI,2026
73
+ monoco/features/agent/resources/workflows/workflow-review.yaml,sha256=uNNmWgMIVgXbvObrJdGovXM2NqxowhWyrFwxkUMAOPo,2563
74
+ monoco/features/agent/resources/zh/skills/flow_engineer/SKILL.md,sha256=wPIh9Tl6jCau2yKUeMZ4ZcvuVZ3XfToooNH7GyHtkUk,2643
75
+ monoco/features/agent/resources/zh/skills/flow_manager/SKILL.md,sha256=GGx1OkhbaN6YIwxXERo_J91-SqIrSAtp96w-cdEm1sI,2582
76
+ monoco/features/agent/resources/zh/skills/flow_planner/SKILL.md,sha256=1cmIQYSH5VL56tjUIZ8eiJlA3zjwm1R5x106JUYoVdU,6153
77
+ monoco/features/agent/resources/zh/skills/flow_reviewer/SKILL.md,sha256=d5pVG89DuaG11MYPY8Kp__dnnK6GaK-rDnHprEEsE28,4235
78
+ monoco/features/config/commands.py,sha256=i6_fKhSGLeO8RCbWrYKxelFgaHWcPiQERS2uxUdq7H0,4894
79
+ monoco/features/glossary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
+ monoco/features/glossary/adapter.py,sha256=8VNl6s5KA2S2frLZkhluFvA0El8K8NSG29jPyauOLZ8,1082
81
+ monoco/features/glossary/config.py,sha256=ghzIPhTFmRcrSyVrZKdmpFRMFrtfL4hJ4dNkKMXT0ys,93
82
+ monoco/features/glossary/resources/en/AGENTS.md,sha256=PfeX2JFbyuqwQySCgXV8HSTsyV-0z7E_oyBLUszkI6U,2096
83
+ monoco/features/glossary/resources/en/skills/monoco_glossary/SKILL.md,sha256=eoFbtCrc7mm4NNDzKDIGJHv5lK6IGMTNLxZ9HVDYcmo,2209
84
+ monoco/features/glossary/resources/zh/AGENTS.md,sha256=Y5zAOZRRCbGYAZitdR7gHJAjJdkXuCQvP5bH_zl8L04,1505
85
+ monoco/features/glossary/resources/zh/skills/monoco_glossary/SKILL.md,sha256=w0z1TcdTV66_KrFR4aBdqLGExFizPbWzO8g9ihAcNH0,1609
86
+ monoco/features/i18n/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
+ monoco/features/i18n/adapter.py,sha256=-ifDKQ7UH8tDoOdB_fSKoIrNRJROIPNuzZor2FPJVfo,932
88
+ monoco/features/i18n/commands.py,sha256=NJ2lZRRjiTW-3UbqxhEKURdWSDxQPkfnBAUgnwoVCL8,8416
89
+ monoco/features/i18n/core.py,sha256=bnEV9D7KgxbC5I3l-1RN1-H8hek1loDL6KFXzmdq0pQ,9658
90
+ monoco/features/i18n/resources/en/AGENTS.md,sha256=zzuF7BW6x8Mj6LZZmeM6wTbG5CSCDMShf4rwtN7XITg,197
91
+ monoco/features/i18n/resources/en/skills/i18n_scan_workflow/SKILL.md,sha256=j_XkXaWBT43fMbPWGCiy4bIOREkqqPRUtR82HVRzWLY,3161
92
+ monoco/features/i18n/resources/en/skills/monoco_i18n/SKILL.md,sha256=2J2YY1YMduMlbnfxSdbm0Qk5ZYQo190j4n0LnWwEOWM,2233
93
+ monoco/features/i18n/resources/zh/AGENTS.md,sha256=lKkwLLCADRH7UDq9no4eQY2sRfJrb64JoZ_HNved8vA,175
94
+ monoco/features/i18n/resources/zh/skills/i18n_scan_workflow/SKILL.md,sha256=d7mS9i_xOHCaD-qugqnIoVer1Ei5h4VgE4NQGSGtJEE,2748
95
+ monoco/features/i18n/resources/zh/skills/monoco_i18n/SKILL.md,sha256=Ouz4gHn3-CGfli7a4_7nW0iLKQPNYx8aRwJ-NKsHnwg,1914
96
+ monoco/features/issue/adapter.py,sha256=4dzKg4-0XH63uORoh8qcolvKxJR6McBDIYxYEcZJJkA,1204
97
+ monoco/features/issue/commands.py,sha256=2iyjzRdtRiWcc6GeZHa-tDZHOHcsJqJhYnQKZ8tv54o,50578
98
+ monoco/features/issue/core.py,sha256=1s7psvgjTBjVwq7CyFSzPdGJ0FgX8q102ODRX6WOsdA,56884
99
+ monoco/features/issue/criticality.py,sha256=Bw0xH0vpx8z59bL-WQjfy4a5zmjXNM0f-aWBzQ5JZCA,18931
100
+ monoco/features/issue/domain_commands.py,sha256=eatSF_uZp4nGpVr2PIgb00MWfEBm0OnyAd4JvUJEAAA,1535
101
+ monoco/features/issue/domain_service.py,sha256=bEs_WXOWmotgIR-lGwyWekF4nonvjsgrK1YG3pyVfwk,2564
102
+ monoco/features/issue/git_service.py,sha256=57FSWiY9qHzOWw_e-IOKinOsiqVJz-ycE1zRtRWuBw8,5956
103
+ monoco/features/issue/linter.py,sha256=EUVsnucLIo32adu2TNP6vFwlUvWrwj18cNN9viRr-7U,38697
104
+ monoco/features/issue/migration.py,sha256=i0xlxZjrpmuHGHOAIN4iu31EwwVIvZn7yjveS-kU22c,4896
105
+ monoco/features/issue/models.py,sha256=3Zwj8pPV4rOmb__HR_tX8l-yyARowDM5eve-keNVxSU,8994
106
+ monoco/features/issue/monitor.py,sha256=vZN0TbR3V5fHKHRGkIhimO6UwWcwYjDHQs2qzjEG174,3549
107
+ monoco/features/issue/resolver.py,sha256=mAU9s7TNNHY9A2278JTwJvxU-jalGKTDJfJdjONev3E,5655
108
+ monoco/features/issue/test_priority_integration.py,sha256=pTBg3Wjv6lLYxWL6vjbo2NGVE-X0MRB3Ha8bqObZrU4,2791
109
+ monoco/features/issue/test_resolver.py,sha256=luFhK37DUvh4a3TTcFYVO-oOIJljQVCSYicwSWyDleQ,2530
110
+ monoco/features/issue/validator.py,sha256=TgXg9MolCI8kPzjaqGVfXMIekaubOc_vTybfakGjteE,33127
111
+ monoco/features/issue/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
+ monoco/features/issue/domain/lifecycle.py,sha256=oIuLYTVy1RRHGngAzbNU4kTWOHMBhjuw_TuYCwNqMJw,4991
113
+ monoco/features/issue/domain/models.py,sha256=s4gezUIlSlKxwJ3Byfxtsemj2-qsu4wRiXTNfaesSYQ,6830
114
+ monoco/features/issue/domain/parser.py,sha256=axfB9BjY-m4DQqYwTQBm_38plOidZaDqFtsIejW_kYI,9095
115
+ monoco/features/issue/domain/workspace.py,sha256=nyTEFNmpLPuX7nssMCBiFI1XBhY9zbqG877Ppp_s0Fg,3658
116
+ monoco/features/issue/engine/__init__.py,sha256=-SBvzjlZJz0O-IB1c95d9pbhr3lydJNLq2vhnfkZ8PQ,747
117
+ monoco/features/issue/engine/config.py,sha256=7enjPW4J_fpuK08ov6LpfQ-9h2T1D4Hc5yIXOPuQvLs,5761
118
+ monoco/features/issue/engine/machine.py,sha256=C2l1bMASB2ruauTQ9nUDc8_5r7HYsyUviUiWruPqax8,8816
119
+ monoco/features/issue/engine/models.py,sha256=595Sx3ncrpg_PhnbBLthohAvuhnjA-_9oXcrsT6Lv0k,574
120
+ monoco/features/issue/lsp/__init__.py,sha256=8bl8-WzSj3C4SkPKgVGnCeyemmvHVWBsuMZsJuJggG8,77
121
+ monoco/features/issue/lsp/definition.py,sha256=cF6Quw1OztuKMJ1zLvgA_ek7lTAdzHF0m4LVznpbAPw,3203
122
+ monoco/features/issue/resources/en/AGENTS.md,sha256=eHHXjLRDAV7IKrYPQSilxu0X5D0SBCAFBXmlSoc9r48,1278
123
+ monoco/features/issue/resources/en/skills/issue_create_workflow/SKILL.md,sha256=Hty3-VhErpNiroCLClT4K62UfhX_LiF6Eh_tkkpWNv0,5407
124
+ monoco/features/issue/resources/en/skills/issue_develop_workflow/SKILL.md,sha256=6eIdn3aJwx9JOUvLt0NmIsQBUFwquA3YMkw_xM_21xQ,7036
125
+ monoco/features/issue/resources/en/skills/issue_lifecycle_workflow/SKILL.md,sha256=ySLtZEkXcHn9mKKmyVg-on5W1ssd8MWAP2fftgtAxKs,4738
126
+ monoco/features/issue/resources/en/skills/issue_refine_workflow/SKILL.md,sha256=YyBcLCPkup6jzIxujpKE3P-aAxqhtVTcjjoEEEVcS78,6185
127
+ monoco/features/issue/resources/en/skills/monoco_issue/SKILL.md,sha256=WISF9qgwyXzNMsHnOoJh9YvF7MG8wD2oM-7h5qNgI2A,5586
128
+ monoco/features/issue/resources/zh/AGENTS.md,sha256=oRHHqeDYx6aEc5FfdL7a-zqT7uh4SYIYt8QBRKEKrYM,1351
129
+ monoco/features/issue/resources/zh/skills/issue_create_workflow/SKILL.md,sha256=0TjDlj4C4_hHCAM11D85Yba-yvKY1D014zr5y8K22GE,4895
130
+ monoco/features/issue/resources/zh/skills/issue_develop_workflow/SKILL.md,sha256=Pss40wlXUSW-f21Dt58qLiYYy1FVNaX0HsU6wVfqh48,6548
131
+ monoco/features/issue/resources/zh/skills/issue_lifecycle_workflow/SKILL.md,sha256=efaneBOYrEGlsk4egyf_KupLGf_meRDmIFLx3b9VYYk,4476
132
+ monoco/features/issue/resources/zh/skills/issue_refine_workflow/SKILL.md,sha256=sy_xnRWwor00WuhtSk9YnD2FKMLuHBMhLJqdTAdkRE0,5182
133
+ monoco/features/issue/resources/zh/skills/monoco_issue/SKILL.md,sha256=vfWezsfyfhuvSJ87eiA01UU7qOHhZxHEIL1OHyPQfyM,6896
134
+ monoco/features/memo/__init__.py,sha256=LC5vwsJw-kwzd5O5oeRo-FNSbnZnuFynanec-hA72nw,88
135
+ monoco/features/memo/adapter.py,sha256=XBOGkP66AMD6Pelz-heH_EhxkYoMRLaH8qsYnX9NSLk,1117
136
+ monoco/features/memo/cli.py,sha256=rw2nEJ3P0eJvjuv4WLOwV6aNM8Dt2J_2R2py_FgHlDg,3329
137
+ monoco/features/memo/core.py,sha256=wq4bf2uS3axoZ5Xsm-YhJZGL8bu1EjcrQuwXgQbPqOk,4193
138
+ monoco/features/memo/resources/en/skills/monoco_memo/SKILL.md,sha256=QKICPgTMYilIKDN6HU6fRYaijfxuo950vTcNswwrKpM,2311
139
+ monoco/features/memo/resources/en/skills/note_processing_workflow/SKILL.md,sha256=YNBhImI8df4pBMtw2PcfzVVBUYJL35AChGWsW_GYMD8,4819
140
+ monoco/features/memo/resources/zh/AGENTS.md,sha256=AFlzvhGxAk77np-E8XLb-tkWJCo0bLGItCrV0IiXdHQ,292
141
+ monoco/features/memo/resources/zh/skills/monoco_memo/SKILL.md,sha256=f7DxbshghdwG1TZ-qb1mVhIXvAd4miwZtw2CL13-Wus,2173
142
+ monoco/features/memo/resources/zh/skills/note_processing_workflow/SKILL.md,sha256=JE3LEhQYRuvU_GAQ_C6Oob4t-BEY7OWxGpBM6mkgato,4286
143
+ monoco/features/spike/adapter.py,sha256=ZIpw-xNVoA2IIP18dbR-dmQGbQmK5ua_P-uGXuDjCeI,1021
144
+ monoco/features/spike/commands.py,sha256=EuJ7trDaobIe7ae7pJ-ftpo_cO8-19R_fAZZCh2JcMg,3871
145
+ monoco/features/spike/core.py,sha256=OuNWXQ-cBttP2oIF0B5iy0aEUH2MUMyGANG8ayEmjPo,4120
146
+ monoco/features/spike/resources/en/AGENTS.md,sha256=NG3CMnlDk_0J8hnRUcueAM9lgIQr_dZ42R_31-LC48E,306
147
+ monoco/features/spike/resources/en/skills/monoco_spike/SKILL.md,sha256=rKAbaOLsWGbRf4y3tBUKrgPAoHNTw3Qj-SL8UE_cq2E,1941
148
+ monoco/features/spike/resources/en/skills/research_workflow/SKILL.md,sha256=YQKLrUfWmIyDik_1scQj7RjApdkIivJD1JUP3B9NDuo,3871
149
+ monoco/features/spike/resources/zh/AGENTS.md,sha256=5RHNl7fc3RdYYTFH483ojJl_arGPKkyYziOuGgFbqqg,290
150
+ monoco/features/spike/resources/zh/skills/monoco_spike/SKILL.md,sha256=-UmjMfsj8E7RVmieZUOYEH01-iD-DcrNcaSJor-sntA,1740
151
+ monoco/features/spike/resources/zh/skills/research_workflow/SKILL.md,sha256=tv9dIEfRNKrfxa3dI657QZDkMO-4-X_ZZRm6V3WS3VM,3333
152
+ monoco_toolkit-0.3.10.dist-info/METADATA,sha256=sgnH1R0aXleqqO9bJCgwUN2Kot753vkRWVDqfEOx40g,4668
153
+ monoco_toolkit-0.3.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
154
+ monoco_toolkit-0.3.10.dist-info/entry_points.txt,sha256=iYj7FWYBdtClU15-Du1skqD0s6SFSIhJvxJ29VWp8ng,43
155
+ monoco_toolkit-0.3.10.dist-info/licenses/LICENSE,sha256=ACAGGjV6aod4eIlVUTx1q9PZbnZGN5bBwkSs9RHj83s,1071
156
+ monoco_toolkit-0.3.10.dist-info/RECORD,,
@@ -1,285 +0,0 @@
1
- import typer
2
- import time
3
- from pathlib import Path
4
- from typing import Optional
5
- from monoco.core.output import print_output
6
- from monoco.core.config import get_config
7
- from monoco.features.scheduler import SessionManager, load_scheduler_config
8
-
9
- app = typer.Typer(name="agent", help="Manage agent sessions")
10
- role_app = typer.Typer(name="role", help="Manage agent roles")
11
-
12
-
13
- @role_app.command(name="list")
14
- def list_roles():
15
- """
16
- List available agent roles and their sources.
17
- """
18
- from monoco.features.scheduler.config import RoleLoader
19
-
20
- settings = get_config()
21
- project_root = Path(settings.paths.root).resolve()
22
-
23
- loader = RoleLoader(project_root)
24
- roles = loader.load_all()
25
-
26
- output = []
27
- for name, role in roles.items():
28
- output.append(
29
- {
30
- "role": name,
31
- "engine": role.engine,
32
- "source": loader.sources.get(name, "unknown"),
33
- "description": role.description,
34
- }
35
- )
36
-
37
- print_output(output, title="Agent Roles")
38
-
39
-
40
- @app.command()
41
- def draft(
42
- desc: str = typer.Option(..., "--desc", "-d", help="Description of the task"),
43
- type: str = typer.Option(
44
- "feature", "--type", "-t", help="Issue type (feature/chore/fix)"
45
- ),
46
- ):
47
- """
48
- Draft a new issue based on a natural language description.
49
- This creates a temporary 'drafter' agent session.
50
- """
51
- from monoco.core.output import print_error
52
-
53
- settings = get_config()
54
- project_root = Path(settings.paths.root).resolve()
55
-
56
- # Load Roles
57
- roles = load_scheduler_config(project_root)
58
- # Use 'crafter' as the role for drafting (it handles new tasks)
59
- role_name = "crafter"
60
- selected_role = roles.get(role_name)
61
-
62
- if not selected_role:
63
- print_error(f"Role '{role_name}' not found.")
64
- raise typer.Exit(code=1)
65
-
66
- print_output(
67
- f"Drafting {type} from description: '{desc}'",
68
- title="Agent Drafter",
69
- )
70
-
71
- manager = SessionManager()
72
- # We use a placeholder ID as we don't know the ID yet.
73
- # The agent is expected to create the file, so the ID will be generated then.
74
- session = manager.create_session("NEW_TASK", selected_role)
75
-
76
- context = {"description": desc, "type": type}
77
-
78
- try:
79
- session.start(context=context)
80
-
81
- # Monitoring Loop
82
- while session.refresh_status() == "running":
83
- time.sleep(1)
84
-
85
- if session.model.status == "failed":
86
- print_error("Drafting failed.")
87
- else:
88
- print_output("Drafting completed.", title="Agent Drafter")
89
-
90
- except KeyboardInterrupt:
91
- print("\nStopping...")
92
- session.terminate()
93
- print_output("Drafting cancelled.")
94
-
95
-
96
- @app.command()
97
- def run(
98
- target: str = typer.Argument(
99
- ..., help="Issue ID (e.g. FEAT-101) or a Task Description in quotes."
100
- ),
101
- role: Optional[str] = typer.Option(
102
- None,
103
- help="Specific role to use (crafter/builder/auditor). Default: intelligent selection.",
104
- ),
105
- detach: bool = typer.Option(
106
- False, "--detach", "-d", help="Run in background (Daemon)"
107
- ),
108
- fail: bool = typer.Option(
109
- False, "--fail", help="Simulate a crash for testing Apoptosis."
110
- ),
111
- ):
112
- """
113
- Start an agent session.
114
- - If TARGET is an Issue ID: Work on that issue.
115
- - If TARGET is a text description: Create a new issue (Crafter).
116
- """
117
- settings = get_config()
118
- project_root = Path(settings.paths.root).resolve()
119
-
120
- # 1. Smart Intent Recognition
121
- import re
122
-
123
- is_id = re.match(r"^[a-zA-Z]+-\d+$", target)
124
-
125
- if is_id:
126
- issue_id = target.upper()
127
- role_name = role or "builder"
128
- description = None
129
- else:
130
- # Implicit Draft Mode via run command
131
- issue_id = "NEW_TASK"
132
- role_name = role or "crafter"
133
- description = target
134
-
135
- # 2. Load Roles
136
- roles = load_scheduler_config(project_root)
137
- selected_role = roles.get(role_name)
138
-
139
- if not selected_role:
140
- from monoco.core.output import print_error
141
-
142
- print_error(f"Role '{role_name}' not found. Available: {list(roles.keys())}")
143
- raise typer.Exit(code=1)
144
-
145
- print_output(
146
- f"Starting Agent Session for '{target}' as {role_name}...",
147
- title="Agent Scheduler",
148
- )
149
-
150
- # 3. Initialize Session
151
- manager = SessionManager()
152
- session = manager.create_session(issue_id, selected_role)
153
-
154
- if detach:
155
- print_output(
156
- "Background mode not fully implemented yet. Running in foreground."
157
- )
158
-
159
- try:
160
- # Pass description if it's a new task
161
- context = {"description": description} if description else None
162
-
163
- if fail:
164
- from monoco.core.output import rprint
165
-
166
- rprint("[bold yellow]DEBUG: Simulating immediate crash...[/bold yellow]")
167
- session.model.status = "failed"
168
- else:
169
- session.start(context=context)
170
-
171
- # Monitoring Loop
172
- while session.refresh_status() == "running":
173
- time.sleep(1)
174
-
175
- if session.model.status == "failed":
176
- from monoco.core.output import print_error
177
-
178
- print_error(
179
- f"Session {session.model.id} FAILED. Use 'monoco agent autopsy {session.model.id}' for analysis."
180
- )
181
- else:
182
- print_output(
183
- f"Session finished with status: {session.model.status}",
184
- title="Agent Scheduler",
185
- )
186
-
187
- except KeyboardInterrupt:
188
- print("\nStopping...")
189
- session.terminate()
190
- print_output("Session terminated.")
191
-
192
-
193
- @app.command()
194
- def kill(session_id: str):
195
- """
196
- Terminate a session.
197
- """
198
- manager = SessionManager()
199
- session = manager.get_session(session_id)
200
- if session:
201
- session.terminate()
202
- print_output(f"Session {session_id} terminated.")
203
- else:
204
- print_output(f"Session {session_id} not found.", style="red")
205
-
206
-
207
- @app.command()
208
- def autopsy(
209
- target: str = typer.Argument(..., help="Session ID or Issue ID to analyze."),
210
- ):
211
- """
212
- Execute Post-Mortem analysis on a failed session or target Issue.
213
- """
214
- from .reliability import ApoptosisManager
215
-
216
- manager = SessionManager()
217
-
218
- print_output(f"Initiating Autopsy for '{target}'...", title="Coroner")
219
-
220
- # Try to find session
221
- session = manager.get_session(target)
222
- if not session:
223
- # Fallback: Treat target as Issue ID and create a dummy failed session context
224
- import re
225
-
226
- if re.match(r"^[a-zA-Z]+-\d+$", target):
227
- print_output(f"Session not in memory. Analyzing Issue {target} directly.")
228
- # We create a transient session just to trigger the coroner
229
- settings = get_config()
230
- project_root = Path(settings.paths.root).resolve()
231
- roles = load_scheduler_config(project_root)
232
- builder_role = roles.get("builder")
233
-
234
- if not builder_role:
235
- print_output("Builder role not found.", style="red")
236
- raise typer.Exit(code=1)
237
-
238
- session = manager.create_session(target.upper(), builder_role)
239
- session.model.status = "failed"
240
- else:
241
- print_output(
242
- f"Could not find session or valid Issue ID for '{target}'", style="red"
243
- )
244
- raise typer.Exit(code=1)
245
-
246
- apoptosis = ApoptosisManager(manager)
247
- apoptosis.trigger_apoptosis(session.model.id)
248
-
249
-
250
- @app.command(name="list")
251
- def list_sessions():
252
- """
253
- List active agent sessions.
254
- """
255
- manager = SessionManager()
256
- sessions = manager.list_sessions()
257
-
258
- output = []
259
- for s in sessions:
260
- output.append(
261
- {
262
- "id": s.model.id,
263
- "issue": s.model.issue_id,
264
- "role": s.model.role_name,
265
- "status": s.model.status,
266
- "branch": s.model.branch_name,
267
- }
268
- )
269
-
270
- print_output(
271
- output
272
- or "No active sessions found (Note: Persistence not implemented in CLI list yet).",
273
- title="Active Sessions",
274
- )
275
-
276
-
277
- @app.command()
278
- def logs(session_id: str):
279
- """
280
- Stream logs for a session.
281
- """
282
- print_output(f"Streaming logs for {session_id}...", title="Session Logs")
283
- # Placeholder
284
- print("[12:00:00] Session started")
285
- print("[12:00:01] Worker initialized")
@@ -1,68 +0,0 @@
1
- from typing import Dict, Optional
2
- import yaml
3
- from pathlib import Path
4
- from .models import RoleTemplate, SchedulerConfig
5
- from .defaults import DEFAULT_ROLES
6
-
7
-
8
- class RoleLoader:
9
- """
10
- Tiered configuration loader for Agent Roles.
11
- Level 1: Builtin Fallback
12
- Level 2: Global (~/.monoco/roles.yaml)
13
- Level 3: Project (./.monoco/roles.yaml)
14
- """
15
-
16
- def __init__(self, project_root: Optional[Path] = None):
17
- self.project_root = project_root
18
- self.user_home = Path.home()
19
- self.roles: Dict[str, RoleTemplate] = {}
20
- self.sources: Dict[str, str] = {} # role_name -> source description
21
-
22
- def load_all(self) -> Dict[str, RoleTemplate]:
23
- # Level 1: Defaults
24
- for role in DEFAULT_ROLES:
25
- self.roles[role.name] = role
26
- self.sources[role.name] = "builtin"
27
-
28
- # Level 2: Global
29
- global_path = self.user_home / ".monoco" / "roles.yaml"
30
- self._load_from_path(global_path, "global")
31
-
32
- # Level 3: Project
33
- if self.project_root:
34
- project_path = self.project_root / ".monoco" / "roles.yaml"
35
- self._load_from_path(project_path, "project")
36
-
37
- return self.roles
38
-
39
- def _load_from_path(self, path: Path, source_label: str):
40
- if not path.exists():
41
- return
42
-
43
- try:
44
- with open(path, "r") as f:
45
- data = yaml.safe_load(f) or {}
46
-
47
- if "roles" in data:
48
- # Validate using SchedulerConfig
49
- config = SchedulerConfig(roles=data["roles"])
50
- for role in config.roles:
51
- # Level 3 > Level 2 > Level 1 (名字相同的 Role 进行覆盖/Merge)
52
- # Currently we do total replacement for same-named roles
53
- self.roles[role.name] = role
54
- self.sources[role.name] = str(path)
55
- except Exception as e:
56
- # We don't want to crash the whole tool if a config is malformed,
57
- # but we should probably warn.
58
- import sys
59
-
60
- print(f"Warning: Failed to load roles from {path}: {e}", file=sys.stderr)
61
-
62
-
63
- def load_scheduler_config(project_root: Path) -> Dict[str, RoleTemplate]:
64
- """
65
- Legacy compatibility wrapper for functional access.
66
- """
67
- loader = RoleLoader(project_root)
68
- return loader.load_all()