comitia 0.1.0__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 (48) hide show
  1. comitia/__init__.py +3 -0
  2. comitia/__main__.py +3 -0
  3. comitia/api.py +68 -0
  4. comitia/catalog.py +82 -0
  5. comitia/cli.py +950 -0
  6. comitia/control.py +156 -0
  7. comitia/diffs.py +120 -0
  8. comitia/discussion/__init__.py +0 -0
  9. comitia/discussion/api.py +152 -0
  10. comitia/discussion/cli.py +1254 -0
  11. comitia/discussion/config.py +167 -0
  12. comitia/discussion/console.py +366 -0
  13. comitia/discussion/converse.py +1221 -0
  14. comitia/discussion/journal.py +382 -0
  15. comitia/discussion/panel.py +1647 -0
  16. comitia/discussion/panel_view.py +445 -0
  17. comitia/discussion/prompts/converse_asker.md +3 -0
  18. comitia/discussion/prompts/converse_summary.md +27 -0
  19. comitia/discussion/transcript.py +88 -0
  20. comitia/engine.py +1223 -0
  21. comitia/findings.py +270 -0
  22. comitia/host.py +2067 -0
  23. comitia/plan.py +957 -0
  24. comitia/posting.py +328 -0
  25. comitia/prompts.py +750 -0
  26. comitia/recipe.py +430 -0
  27. comitia/report.py +581 -0
  28. comitia/settings.py +66 -0
  29. comitia/skill/SKILL.md +75 -0
  30. comitia/starters/decision-debate.yml +27 -0
  31. comitia/starters/deep-review.yml +12 -0
  32. comitia/starters/message-test.yml +15 -0
  33. comitia/starters/pr-review-light.yml +78 -0
  34. comitia/starters/pr-review.yml +100 -0
  35. comitia/starters/prd-review.yml +10 -0
  36. comitia/store.py +212 -0
  37. comitia/web/__init__.py +13 -0
  38. comitia/web/server.py +244 -0
  39. comitia/web/service.py +679 -0
  40. comitia/web/static/app.js +1521 -0
  41. comitia/web/static/index.html +38 -0
  42. comitia/web/static/styles.css +262 -0
  43. comitia-0.1.0.dist-info/METADATA +589 -0
  44. comitia-0.1.0.dist-info/RECORD +48 -0
  45. comitia-0.1.0.dist-info/WHEEL +4 -0
  46. comitia-0.1.0.dist-info/entry_points.txt +2 -0
  47. comitia-0.1.0.dist-info/licenses/LICENSE +21 -0
  48. comitia-0.1.0.dist-info/licenses/LICENSES/crossby-MIT.txt +21 -0
comitia/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """comitia: several AI models review a spec, and every finding keeps its history."""
2
+
3
+ __version__ = "0.1.0"
comitia/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from comitia.cli import main
2
+
3
+ main()
comitia/api.py ADDED
@@ -0,0 +1,68 @@
1
+ """comitia's library entry point: consultations and panels from Python.
2
+
3
+ This is the supported contract. Before 1.0 a minor release may change it, with a
4
+ migration note, so pin a minor series (``comitia>=X.Y.0,<X.(Y+1).0``).
5
+
6
+ The names and arguments are those ``crossby.api`` used for the same engine, so a
7
+ program moving from ``crossby.api`` changes only its import. ``converse`` is the
8
+ two-agent consultation (``run_conversation``); ``panel`` is a lead consulting
9
+ read-only members by id. There is no approval gate here: approval presets apply
10
+ to comitia's commands, and a program can start agents through crossby anyway.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from comitia.discussion.api import continue_panel, panel, read_conversation, read_panel
16
+ from comitia.discussion.converse import (
17
+ ConversationResult,
18
+ ConverseError,
19
+ ConverseTurn,
20
+ StopReason,
21
+ )
22
+ from comitia.discussion.converse import Participant as ConverseParticipant
23
+ from comitia.discussion.converse import Role as ConverseRole
24
+ from comitia.discussion.converse import run_conversation as converse
25
+ from comitia.discussion.journal import ConversationEvent, EventSink, EventType
26
+ from comitia.discussion.panel import (
27
+ HumanBackend,
28
+ HumanInput,
29
+ HumanReply,
30
+ InputRequest,
31
+ Lead,
32
+ Member,
33
+ PanelError,
34
+ PanelResult,
35
+ PanelSpec,
36
+ PanelTurn,
37
+ ProtocolError,
38
+ render_panel_transcript,
39
+ )
40
+
41
+ __all__ = [
42
+ "ConversationEvent",
43
+ "ConversationResult",
44
+ "ConverseError",
45
+ "ConverseParticipant",
46
+ "ConverseRole",
47
+ "ConverseTurn",
48
+ "EventSink",
49
+ "EventType",
50
+ "HumanBackend",
51
+ "HumanInput",
52
+ "HumanReply",
53
+ "InputRequest",
54
+ "Lead",
55
+ "Member",
56
+ "PanelError",
57
+ "PanelResult",
58
+ "PanelSpec",
59
+ "PanelTurn",
60
+ "ProtocolError",
61
+ "StopReason",
62
+ "continue_panel",
63
+ "converse",
64
+ "panel",
65
+ "read_conversation",
66
+ "read_panel",
67
+ "render_panel_transcript",
68
+ ]
comitia/catalog.py ADDED
@@ -0,0 +1,82 @@
1
+ """What a recipe can choose from: the tools crossby can ask, their models and efforts.
2
+
3
+ Read from crossby's adapters (``crossby.ai_tools``, a supported export), so the
4
+ lists follow the installed crossby. The model list is crossby's bundled
5
+ catalog: a tool may accept other names, which a recipe can still give.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import json
11
+ import shutil
12
+ from pathlib import Path
13
+ from typing import Any
14
+
15
+ from crossby.ai_tools import AbstractAITool
16
+ from crossby.api import AIToolID, family_of
17
+
18
+ from comitia.plan import PERSONA_INSTRUCTIONS
19
+
20
+
21
+ def tools() -> list[dict[str, Any]]:
22
+ """Every tool that can take part, with what its form fields may hold."""
23
+ found: list[dict[str, Any]] = []
24
+ for tool in AIToolID:
25
+ try:
26
+ adapter = AbstractAITool.get(tool)
27
+ caps = adapter.capabilities()
28
+ if not caps.supports_headless:
29
+ continue
30
+ models = [
31
+ {
32
+ "id": model.id,
33
+ "tier": model.tier.value if model.tier else None,
34
+ "family": family_of(model.id),
35
+ }
36
+ for model in adapter.get_models()
37
+ ]
38
+ found.append(
39
+ {
40
+ "id": tool.value,
41
+ "name": caps.display_name,
42
+ "installed": shutil.which(caps.binary) is not None,
43
+ "models": models if caps.supports_model_flag else [],
44
+ "takes_model": bool(caps.supports_model_flag),
45
+ "efforts": [e.value for e in caps.supported_efforts]
46
+ if caps.supports_effort
47
+ else [],
48
+ }
49
+ )
50
+ except Exception:
51
+ # An adapter this crossby cannot describe still works by name in the YAML.
52
+ continue
53
+ return found
54
+
55
+
56
+ def skills(root: Path) -> list[str]:
57
+ """Skill folders of the project: each holds a ``SKILL.md``."""
58
+ found = set()
59
+ for pattern in ("skills/*", "*/skills/*", ".claude/skills/*", ".agents/skills/*"):
60
+ for path in root.glob(f"{pattern}/SKILL.md"):
61
+ found.add(path.parent.relative_to(root).as_posix())
62
+ return sorted(found)
63
+
64
+
65
+ def mcp(root: Path) -> list[str]:
66
+ """Names of the MCP servers the project defines in ``.mcp.json``."""
67
+ try:
68
+ declared = json.loads((root / ".mcp.json").read_text(encoding="utf-8"))["mcpServers"]
69
+ except (OSError, ValueError, KeyError, TypeError):
70
+ return []
71
+ return sorted(declared) if isinstance(declared, dict) else []
72
+
73
+
74
+ def personas(root: Path) -> list[str]:
75
+ """Folders of the project that hold a persona: an ``instructions.md``."""
76
+ found = []
77
+ for pattern in (f"*/{PERSONA_INSTRUCTIONS}", f"*/*/{PERSONA_INSTRUCTIONS}"):
78
+ for path in root.glob(pattern):
79
+ relative = path.parent.relative_to(root)
80
+ if not any(part.startswith(".") for part in relative.parts):
81
+ found.append(relative.as_posix())
82
+ return sorted(found)