cfgit 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.
@@ -0,0 +1,5 @@
1
+ # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
+ """ApprovalProvider implementations (SPEC §11). local (TTY) first, then slack/webhook."""
3
+ from cfg.approval.base import ApprovalProvider, ApprovalState, Pending
4
+
5
+ __all__ = ["ApprovalProvider", "ApprovalState", "Pending"]
cfg/approval/base.py ADDED
@@ -0,0 +1,29 @@
1
+ # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
+ """ApprovalProvider — the real human-in-the-loop (SPEC §11).
3
+
4
+ The keystone for "safe for agents AND safe for fat-fingers." A gated-env mutation
5
+ NEVER completes from a caller-supplied flag; it completes only when a human resolves
6
+ an approval OUT OF BAND (a different channel / a separate invocation). There is
7
+ intentionally NO MCP tool that grants approval — an agent can observe status, never
8
+ grant it (SPEC §5.18, §12).
9
+ """
10
+ from __future__ import annotations
11
+
12
+ from dataclasses import dataclass
13
+ from typing import Literal, Protocol, runtime_checkable
14
+
15
+ ApprovalState = Literal["pending", "approved", "denied", "expired"]
16
+
17
+
18
+ @dataclass
19
+ class Pending:
20
+ approval_id: str
21
+ state: ApprovalState # "pending" on creation
22
+
23
+
24
+ @runtime_checkable
25
+ class ApprovalProvider(Protocol):
26
+ def request(self, *, action: dict, requester: str, env: str) -> Pending: ...
27
+ def status(self, approval_id: str) -> ApprovalState: ...
28
+ # resolution (approve/deny) happens OUT OF BAND, not through this caller.
29
+ # The id is single-use and bound to (action, plan_oid); a changed plan invalidates it.
cfg/cli/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ # Copyright 2026 Mohammad Ausaf. Licensed under the Apache License, Version 2.0.
2
+ """Porcelain + plumbing CLI (SPEC §5). `cfg <verb>`; `--json` for scripts/agents."""