thuthi-plugin 0.0.0-stage → 0.1.0
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.
- package/.claude-plugin/marketplace.json +55 -0
- package/README.md +13 -2
- package/bin/parallel-browser.js +109 -0
- package/extension/background.js +1329 -0
- package/extension/config.json +1 -0
- package/extension/guard.js +44 -0
- package/extension/manifest.json +10 -0
- package/extension/overlay.js +104 -0
- package/extension/popup.html +34 -0
- package/extension/popup.js +39 -0
- package/extension-reloader/manifest.json +13 -0
- package/extension-reloader/sw.js +17 -0
- package/package.json +13 -4
- package/plugins/thuthi/.claude-plugin/plugin.json +8 -0
- package/plugins/thuthi/context.md +3 -0
- package/plugins/thuthi/hooks/hooks.json +15 -0
- package/plugins/thuthi/skills/setup/SKILL.md +55 -0
- package/plugins/thuthi/skills/setup/scripts/doctor.py +249 -0
- package/plugins/thuthi/skills/setup/scripts/selftest.py +188 -0
- package/plugins/thuthi/tools/claude-switch/claude_switch.py +8 -0
- package/plugins/thuthi/tools/legacy_launcher.py +65 -0
- package/plugins/thuthi/tools/statusline/statusline.py +8 -0
- package/plugins/thuthi-accounts/.claude-plugin/plugin.json +9 -0
- package/plugins/thuthi-accounts/bin/claude-switch +5 -0
- package/plugins/thuthi-accounts/bin/claude-switch.cmd +4 -0
- package/plugins/thuthi-accounts/hooks/hooks.json +15 -0
- package/plugins/thuthi-accounts/lib/tls.py +68 -0
- package/plugins/thuthi-accounts/lib/usage_store.py +150 -0
- package/plugins/thuthi-accounts/setup_check.py +21 -0
- package/plugins/thuthi-accounts/skills/claude-switch/SKILL.md +48 -0
- package/plugins/thuthi-accounts/tools/claude-switch/claude-switch-tui.py +397 -0
- package/plugins/thuthi-accounts/tools/claude-switch/claude_switch.py +1204 -0
- package/plugins/thuthi-accounts/tools/claude-switch/credstore.py +417 -0
- package/plugins/thuthi-accounts/tools/claude-switch/install.py +301 -0
- package/plugins/thuthi-accounts/tools/claude-switch/tests/selftest.py +491 -0
- package/plugins/thuthi-accounts/tools/statusline/statusline.py +212 -0
- package/plugins/thuthi-agenda-picker/.claude-plugin/plugin.json +9 -0
- package/plugins/thuthi-agenda-picker/context.md +3 -0
- package/plugins/thuthi-agenda-picker/hooks/hooks.json +15 -0
- package/plugins/thuthi-agenda-picker/lib/pbpage.py +397 -0
- package/plugins/thuthi-agenda-picker/setup_check.py +18 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/SKILL.md +280 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/design-rules.md +110 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/diagram/base.css +33 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/agenda.json +146 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/A-dark.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/A-light.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/B-dark.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/B-light.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/C-dark.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/C-light.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/base.css +33 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/name-B.html +15 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/now-dark.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/references/example/shots/now-light.svg +5 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/picker.py +1286 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/selftest.py +771 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/shot.py +117 -0
- package/plugins/thuthi-agenda-picker/skills/agenda-picker/scripts/template.html +1029 -0
- package/plugins/thuthi-arch-diagram/.claude-plugin/plugin.json +9 -0
- package/plugins/thuthi-arch-diagram/lib/pbpage.py +397 -0
- package/plugins/thuthi-arch-diagram/lib/tls.py +68 -0
- package/plugins/thuthi-arch-diagram/setup_check.py +10 -0
- package/plugins/thuthi-arch-diagram/skills/arch-diagram/SKILL.md +125 -0
- package/plugins/thuthi-arch-diagram/skills/arch-diagram/references/design-rules.md +110 -0
- package/plugins/thuthi-arch-diagram/skills/arch-diagram/references/example-shop.py +167 -0
- package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/check.py +194 -0
- package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/diagramkit.py +682 -0
- package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/interact_test.py +115 -0
- package/plugins/thuthi-arch-diagram/skills/arch-diagram/scripts/render.py +113 -0
- package/plugins/thuthi-browser/.claude-plugin/plugin.json +9 -0
- package/plugins/thuthi-browser/context.md +3 -0
- package/plugins/thuthi-browser/hooks/hooks.json +15 -0
- package/plugins/thuthi-browser/lib/pbpage.py +397 -0
- package/plugins/thuthi-browser/setup_check.py +93 -0
- package/plugins/thuthi-browser/skills/parallel-browser/SKILL.md +271 -0
- package/plugins/thuthi-browser/skills/parallel-browser/references/api.md +243 -0
- package/plugins/thuthi-browser/skills/parallel-browser/references/install.md +106 -0
- package/plugins/thuthi-demo-video/.claude-plugin/plugin.json +9 -0
- package/plugins/thuthi-demo-video/lib/pbpage.py +397 -0
- package/plugins/thuthi-demo-video/setup_check.py +14 -0
- package/plugins/thuthi-demo-video/skills/demo-video/SKILL.md +261 -0
- package/plugins/thuthi-demo-video/skills/demo-video/scripts/caption.html +16 -0
- package/plugins/thuthi-demo-video/skills/demo-video/scripts/cursor.js +132 -0
- package/plugins/thuthi-demo-video/skills/demo-video/scripts/demo_video.py +2416 -0
- package/plugins/thuthi-demo-video/skills/demo-video/scripts/example_scenario.py +97 -0
- package/plugins/thuthi-demo-video/skills/demo-video/scripts/frame.html +95 -0
- package/plugins/thuthi-demo-video/skills/demo-video/scripts/overlay.js +129 -0
- package/plugins/thuthi-demo-video/skills/demo-video/scripts/title.html +30 -0
- package/plugins/thuthi-no-more-slop/.claude-plugin/plugin.json +9 -0
- package/plugins/thuthi-no-more-slop/setup_check.py +10 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/LICENSE +21 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/SKILL.md +235 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/SOURCE.txt +1 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/agents/openai.yaml +6 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/references/examples.md +289 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/references/tokens.md +46 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/references/unslop-fallback.md +36 -0
- package/plugins/thuthi-no-more-slop/skills/no-more-slop/scripts/count_tells.py +426 -0
- package/plugins/thuthi-orca/.claude-plugin/plugin.json +9 -0
- package/plugins/thuthi-orca/context.md +5 -0
- package/plugins/thuthi-orca/hooks/hooks.json +18 -0
- package/plugins/thuthi-orca/hooks/orca-team-grid.ts +21 -0
- package/plugins/thuthi-orca/setup_check.py +12 -0
- package/plugins/thuthi-orca/skills/orca-new-work/SKILL.md +492 -0
- package/plugins/thuthi-orca/tools/orca-team-grid/bin/tmux +338 -0
- package/plugins/thuthi-orca/tools/orca-team-grid/tests/selftest.py +299 -0
- package/runtime/client.js +69 -0
- package/runtime/daemon.js +503 -0
- package/runtime/focus-monitor.js +53 -0
- package/runtime/keys.js +86 -0
- package/runtime/owner.js +64 -0
- package/runtime/recorder.js +267 -0
- package/runtime/relay.js +95 -0
- package/runtime/session.js +1599 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""안건 그림을 parallel-browser 로 찍는다. 안마다 같은 크기 · 같은 배율로 찍으려는 도구다.
|
|
3
|
+
|
|
4
|
+
shot.py <URL 또는 HTML 파일> <out.png> [--size 1200x560] [--dpr 2] [--full | --fit] [--dark] [--wait 300]
|
|
5
|
+
shot.py --batch shots.json [{"src": …, "out": …, "size": "1200x560", "dark": false, "fit": true}, …] 를 한 세션으로
|
|
6
|
+
|
|
7
|
+
- --fit 은 높이를 내용 (body 아래 끝) 에 맞춰 자른다. 직접 그린 개념 그림 아래에 빈 자리가 찍히지 않게 쓴다 (--size 의 높이는 넘지 않는다).
|
|
8
|
+
- HTML 파일은 그 폴더를 127.0.0.1 임시 서버로 연다 (확장은 file:// 을 못 열 수 있다).
|
|
9
|
+
- 화면 크기 · 배율 · 라이트/다크(prefers-color-scheme) 를 고정하고, parallel-browser 상태 표시는 숨긴 채 찍는다.
|
|
10
|
+
- 사용자 Chrome · Edge 의 에이전트 창에서 돌고 포커스를 가져가지 않는다. 다 찍으면 탭 · 세션을 닫는다.
|
|
11
|
+
- 로그인이 필요한 앱 화면은 이 도구 대신 thuthi-browser:parallel-browser 스킬로 직접 몰아 찍는다 (같은 크기는
|
|
12
|
+
`s.cdp('Emulation.setDeviceMetricsOverride', {width, height, deviceScaleFactor, mobile: false})`).
|
|
13
|
+
"""
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
import functools
|
|
18
|
+
import json
|
|
19
|
+
import sys
|
|
20
|
+
import threading
|
|
21
|
+
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from urllib.parse import quote
|
|
24
|
+
|
|
25
|
+
sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "lib"))
|
|
26
|
+
from pbpage import Browser # noqa: E402
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Quiet(SimpleHTTPRequestHandler):
|
|
30
|
+
def log_message(self, *a):
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Files:
|
|
35
|
+
"""HTML 파일이 든 폴더마다 임시 서버 하나."""
|
|
36
|
+
|
|
37
|
+
def __init__(self):
|
|
38
|
+
self.servers: dict[Path, ThreadingHTTPServer] = {}
|
|
39
|
+
|
|
40
|
+
def url(self, src: str) -> str:
|
|
41
|
+
if src.startswith(("http://", "https://", "data:")):
|
|
42
|
+
return src
|
|
43
|
+
p = Path(src).expanduser().resolve()
|
|
44
|
+
if not p.is_file():
|
|
45
|
+
raise SystemExit(f"파일이 없다: {p}")
|
|
46
|
+
srv = self.servers.get(p.parent)
|
|
47
|
+
if not srv:
|
|
48
|
+
srv = ThreadingHTTPServer(("127.0.0.1", 0), functools.partial(Quiet, directory=str(p.parent)))
|
|
49
|
+
threading.Thread(target=srv.serve_forever, daemon=True).start()
|
|
50
|
+
self.servers[p.parent] = srv
|
|
51
|
+
return f"http://127.0.0.1:{srv.server_address[1]}/{quote(p.name)}"
|
|
52
|
+
|
|
53
|
+
def close(self):
|
|
54
|
+
for s in self.servers.values():
|
|
55
|
+
s.shutdown()
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def size_of(text: str) -> tuple[int, int]:
|
|
59
|
+
w, h = text.lower().split("x")
|
|
60
|
+
return int(w), int(h)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def main() -> int:
|
|
64
|
+
for _f in (sys.stdout, sys.stderr): # Windows 콘솔(cp949)에서 ✓ · 한글을 찍다 죽지 않게
|
|
65
|
+
try:
|
|
66
|
+
_f.reconfigure(encoding="utf-8", errors="replace")
|
|
67
|
+
except (AttributeError, ValueError):
|
|
68
|
+
pass
|
|
69
|
+
ap = argparse.ArgumentParser(description="안건 그림 찍기 (parallel-browser)")
|
|
70
|
+
ap.add_argument("src", nargs="?")
|
|
71
|
+
ap.add_argument("out", nargs="?")
|
|
72
|
+
ap.add_argument("--size", default="1200x560")
|
|
73
|
+
ap.add_argument("--dpr", type=float, default=2)
|
|
74
|
+
ap.add_argument("--full", action="store_true", help="페이지 전체 높이")
|
|
75
|
+
ap.add_argument("--fit", action="store_true", help="높이를 내용에 맞춰 자른다 (--size 높이가 최대)")
|
|
76
|
+
ap.add_argument("--dark", action="store_true", help="prefers-color-scheme: dark")
|
|
77
|
+
ap.add_argument("--wait", type=int, default=300, help="뜬 뒤 기다릴 ms")
|
|
78
|
+
ap.add_argument("--batch", help="여러 장을 한 세션으로: JSON 배열 파일")
|
|
79
|
+
a = ap.parse_args()
|
|
80
|
+
jobs = json.loads(Path(a.batch).read_text()) if a.batch else [{"src": a.src, "out": a.out}]
|
|
81
|
+
if not jobs or not all(j.get("src") and j.get("out") for j in jobs):
|
|
82
|
+
ap.error("src 와 out 이 필요하다")
|
|
83
|
+
files = Files()
|
|
84
|
+
try:
|
|
85
|
+
with Browser("agenda-picker 그림") as b:
|
|
86
|
+
pg = None
|
|
87
|
+
for j in jobs:
|
|
88
|
+
w, h = size_of(j.get("size", a.size))
|
|
89
|
+
dpr = float(j.get("dpr", a.dpr))
|
|
90
|
+
dark = bool(j.get("dark", a.dark))
|
|
91
|
+
if pg is None:
|
|
92
|
+
pg = b.new_page(viewport=(w, h), dpr=dpr, color_scheme="dark" if dark else "light")
|
|
93
|
+
else:
|
|
94
|
+
pg.set_viewport(w, h, dpr)
|
|
95
|
+
pg.cdp("Emulation.setEmulatedMedia", {"features": [{"name": "prefers-color-scheme", "value": "dark" if dark else "light"}]})
|
|
96
|
+
pg.goto(files.url(j["src"]))
|
|
97
|
+
pg.wait_for_timeout(int(j.get("wait", a.wait)))
|
|
98
|
+
if j.get("fit", a.fit):
|
|
99
|
+
ch = pg.evaluate("""(() => { const b = document.body, cs = getComputedStyle(b);
|
|
100
|
+
let bottom = 0;
|
|
101
|
+
for (const el of b.querySelectorAll('*')) { const r = el.getBoundingClientRect(); if (r.width && r.height) bottom = Math.max(bottom, r.bottom); }
|
|
102
|
+
return Math.ceil(bottom + parseFloat(cs.paddingBottom) + parseFloat(cs.marginBottom)); })()""")
|
|
103
|
+
if 0 < ch < h:
|
|
104
|
+
h = ch
|
|
105
|
+
pg.set_viewport(w, h, dpr)
|
|
106
|
+
pg.wait_for_timeout(100)
|
|
107
|
+
out = Path(j["out"]).expanduser()
|
|
108
|
+
out.parent.mkdir(parents=True, exist_ok=True)
|
|
109
|
+
pg.screenshot(str(out), full_page=bool(j.get("full", a.full)))
|
|
110
|
+
print(f"{out} ({w}x{h} @{dpr:g}x{' dark' if dark else ''})")
|
|
111
|
+
finally:
|
|
112
|
+
files.close()
|
|
113
|
+
return 0
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
if __name__ == "__main__":
|
|
117
|
+
sys.exit(main())
|