duckgap 0.0.1__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.
- duckgap-0.0.1/.gitignore +5 -0
- duckgap-0.0.1/LICENSE +21 -0
- duckgap-0.0.1/PKG-INFO +19 -0
- duckgap-0.0.1/README.md +7 -0
- duckgap-0.0.1/pyproject.toml +20 -0
- duckgap-0.0.1/src/duckgap/__init__.py +3 -0
- duckgap-0.0.1/src/duckgap/__main__.py +3 -0
- duckgap-0.0.1/src/duckgap/_logo.py +16 -0
- duckgap-0.0.1/src/duckgap/cli.py +120 -0
duckgap-0.0.1/.gitignore
ADDED
duckgap-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oleksandr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
duckgap-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: duckgap
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Silent contract-drift detection for AI agents. Placeholder release.
|
|
5
|
+
Author: Oleksandr
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 1 - Planning
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# duckgap
|
|
14
|
+
|
|
15
|
+
Silent contract-drift detection for AI agents.
|
|
16
|
+
|
|
17
|
+
Status: placeholder release. Nothing is functional yet.
|
|
18
|
+
|
|
19
|
+
Run `duckgap` to see the banner.
|
duckgap-0.0.1/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "duckgap"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "Silent contract-drift detection for AI agents. Placeholder release."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [{name = "Oleksandr"}]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 1 - Planning",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
]
|
|
17
|
+
dependencies = []
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
duckgap = "duckgap.cli:main"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
GRID = [
|
|
2
|
+
".....XXXX...",
|
|
3
|
+
"....XX.XX...",
|
|
4
|
+
"....XXXXXBBB",
|
|
5
|
+
"....XXXXXBB.",
|
|
6
|
+
"XX...XXXX...",
|
|
7
|
+
"XXXXXXXXXX..",
|
|
8
|
+
".XXXXXXXXXX.",
|
|
9
|
+
".XXXXXXXXXX.",
|
|
10
|
+
"..XXXXXXXX..",
|
|
11
|
+
"...XXXXXX...",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
DARK = "#1A1A1A"
|
|
15
|
+
LIGHT = "#FAFAFA"
|
|
16
|
+
ACCENT = "#0E7A82"
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from . import __version__
|
|
6
|
+
from ._logo import ACCENT, DARK, GRID, LIGHT
|
|
7
|
+
|
|
8
|
+
RESET = "\x1b[0m"
|
|
9
|
+
BOLD = "\x1b[1m"
|
|
10
|
+
WIDTH = 14
|
|
11
|
+
HEIGHT = 12
|
|
12
|
+
|
|
13
|
+
TEXT_LINES = {
|
|
14
|
+
1: BOLD + "duckgap {version}" + RESET,
|
|
15
|
+
2: "Silent contract-drift detection for AI agents",
|
|
16
|
+
3: "Placeholder release. Nothing is functional yet.",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _rgb(hex_color):
|
|
21
|
+
h = hex_color.lstrip("#")
|
|
22
|
+
return tuple(int(h[i:i + 2], 16) for i in (0, 2, 4))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def build_matrix():
|
|
26
|
+
"""Return HEIGHT x WIDTH pixels: hex string, or None for transparent."""
|
|
27
|
+
m = [[DARK] * WIDTH for _ in range(HEIGHT)]
|
|
28
|
+
for r, c in ((0, 0), (0, WIDTH - 1), (HEIGHT - 1, 0), (HEIGHT - 1, WIDTH - 1)):
|
|
29
|
+
m[r][c] = None
|
|
30
|
+
colors = {"X": LIGHT, "B": ACCENT, ".": DARK}
|
|
31
|
+
for y, row in enumerate(GRID):
|
|
32
|
+
for x, ch in enumerate(row):
|
|
33
|
+
m[y + 1][x + 1] = colors[ch]
|
|
34
|
+
return m
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _xterm_index(rgb):
|
|
38
|
+
levels = (0, 95, 135, 175, 215, 255)
|
|
39
|
+
best, best_d = 16, None
|
|
40
|
+
candidates = []
|
|
41
|
+
for r in range(6):
|
|
42
|
+
for g in range(6):
|
|
43
|
+
for b in range(6):
|
|
44
|
+
candidates.append((16 + 36 * r + 6 * g + b,
|
|
45
|
+
(levels[r], levels[g], levels[b])))
|
|
46
|
+
for i in range(24):
|
|
47
|
+
v = 8 + 10 * i
|
|
48
|
+
candidates.append((232 + i, (v, v, v)))
|
|
49
|
+
for idx, c in candidates:
|
|
50
|
+
d = sum((a - b) ** 2 for a, b in zip(rgb, c))
|
|
51
|
+
if best_d is None or d < best_d:
|
|
52
|
+
best, best_d = idx, d
|
|
53
|
+
return best
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _make_color(truecolor):
|
|
57
|
+
def fg_bg(hex_color):
|
|
58
|
+
rgb = _rgb(hex_color)
|
|
59
|
+
if truecolor:
|
|
60
|
+
return "2;%d;%d;%d" % rgb
|
|
61
|
+
return "5;%d" % _xterm_index(rgb)
|
|
62
|
+
return fg_bg
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def render_logo(truecolor):
|
|
66
|
+
code = _make_color(truecolor)
|
|
67
|
+
m = build_matrix()
|
|
68
|
+
lines = []
|
|
69
|
+
for y in range(0, HEIGHT, 2):
|
|
70
|
+
out = []
|
|
71
|
+
for x in range(WIDTH):
|
|
72
|
+
top, bot = m[y][x], m[y + 1][x]
|
|
73
|
+
if top and bot:
|
|
74
|
+
out.append("\x1b[38;%sm\x1b[48;%sm▀" % (code(top), code(bot)))
|
|
75
|
+
elif bot:
|
|
76
|
+
out.append("\x1b[38;%sm▄" % code(bot))
|
|
77
|
+
elif top:
|
|
78
|
+
out.append("\x1b[38;%sm▀" % code(top))
|
|
79
|
+
else:
|
|
80
|
+
out.append(" ")
|
|
81
|
+
if top or bot:
|
|
82
|
+
out.append(RESET)
|
|
83
|
+
lines.append("".join(out) + RESET)
|
|
84
|
+
return lines
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _plain_mode():
|
|
88
|
+
return (
|
|
89
|
+
bool(os.environ.get("NO_COLOR"))
|
|
90
|
+
or os.environ.get("TERM") == "dumb"
|
|
91
|
+
or not sys.stdout.isatty()
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def main(argv=None):
|
|
96
|
+
parser = argparse.ArgumentParser(prog="duckgap")
|
|
97
|
+
parser.add_argument("--version", action="version",
|
|
98
|
+
version="duckgap " + __version__)
|
|
99
|
+
parser.add_argument("--no-logo", action="store_true")
|
|
100
|
+
args = parser.parse_args(argv)
|
|
101
|
+
|
|
102
|
+
if _plain_mode():
|
|
103
|
+
print("duckgap %s — placeholder release, not functional yet" % __version__)
|
|
104
|
+
return 0
|
|
105
|
+
|
|
106
|
+
if sys.platform == "win32":
|
|
107
|
+
os.system("")
|
|
108
|
+
|
|
109
|
+
text = {i: t.format(version=__version__) for i, t in TEXT_LINES.items()}
|
|
110
|
+
if args.no_logo:
|
|
111
|
+
rows = [text[i] for i in sorted(text)]
|
|
112
|
+
else:
|
|
113
|
+
truecolor = os.environ.get("COLORTERM") in {"truecolor", "24bit"}
|
|
114
|
+
logo = render_logo(truecolor)
|
|
115
|
+
rows = [
|
|
116
|
+
logo[i] + (" " + text[i] if i in text else "")
|
|
117
|
+
for i in range(len(logo))
|
|
118
|
+
]
|
|
119
|
+
sys.stdout.write("\n".join(rows) + "\n")
|
|
120
|
+
return 0
|