tzero-mcp 12.3.6 → 12.3.7
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/README.md +32 -21
- package/package.json +1 -1
- package/src/addmcp.py +2 -2
- package/src/app.py +1 -1
- package/src/tzero/__init__.py +8 -1
- package/src/tzero/tzero_agency.py +2574 -0
- package/src/tzero/tzero_benchmark.py +1 -1
- package/src/tzero/tzero_budget.py +1 -1
- package/src/tzero/tzero_ci.py +1 -1
- package/src/tzero/tzero_contracts.py +2 -2
- package/src/tzero/tzero_dashboard.py +50 -3
- package/src/tzero/tzero_debt.py +1 -1
- package/src/tzero/tzero_explain.py +1 -1
- package/src/tzero/tzero_golden.py +2 -2
- package/src/tzero/tzero_growth.py +1 -1
- package/src/tzero/tzero_lsp.py +1 -1
- package/src/tzero/tzero_mcp.py +72 -1
- package/src/tzero/tzero_promo.py +1 -1
- package/src/tzero/tzero_task_benchmark.py +2 -2
- package/src/tzero/tzero_traffic.py +1 -1
- package/src/tzero/tzero_tui.py +2 -2
- package/src/tzero/tzero_v3.py +522 -18
- package/src/tzero/tzero_welcome.py +1 -1
package/src/tzero/tzero_v3.py
CHANGED
|
@@ -494,7 +494,7 @@ def calculate_token_cost(token_count: int, provider_name: str) -> float:
|
|
|
494
494
|
# i18n Translations
|
|
495
495
|
TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
496
496
|
"en": {
|
|
497
|
-
"title": "T-Zero Developer Console & Context Architect v12.3.
|
|
497
|
+
"title": "T-Zero Developer Console & Context Architect v12.3.7",
|
|
498
498
|
"subtitle": f"Developer: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
|
|
499
499
|
"overview_tab": "🏠 Overview Dashboard",
|
|
500
500
|
"setup_tab": "⚡ Setup & AI Models",
|
|
@@ -531,7 +531,7 @@ TRANSLATIONS: Dict[str, Dict[str, str]] = {
|
|
|
531
531
|
"audit_btn": "🛡️ SECURITY AUDIT"
|
|
532
532
|
},
|
|
533
533
|
"tr": {
|
|
534
|
-
"title": "T-Zero Developer Console & Context Architect v12.3.
|
|
534
|
+
"title": "T-Zero Developer Console & Context Architect v12.3.7",
|
|
535
535
|
"subtitle": f"Developer: {DEV_NAME} | {DEV_URL_MAIN} | {DEV_URL_BIO}",
|
|
536
536
|
"overview_tab": "🏠 Overview Dashboard",
|
|
537
537
|
"setup_tab": "⚡ Setup & AI Models",
|
|
@@ -4831,7 +4831,7 @@ class AutoReadmeGUI:
|
|
|
4831
4831
|
bg_color=PALETTE["card_border"],
|
|
4832
4832
|
text_color=PALETTE.get("accent_purple", "#6366f1"),
|
|
4833
4833
|
font=("Segoe UI", 7, "bold"),
|
|
4834
|
-
width=
|
|
4834
|
+
width=112
|
|
4835
4835
|
)
|
|
4836
4836
|
self.quick_theme_btn.pack(side=tk.LEFT, padx=3)
|
|
4837
4837
|
|
|
@@ -4844,10 +4844,23 @@ class AutoReadmeGUI:
|
|
|
4844
4844
|
bg_color=PALETTE.get("card_hover", "#e0e7ff"),
|
|
4845
4845
|
text_color=PALETTE.get("accent_cyan", "#3843a0"),
|
|
4846
4846
|
font=("Segoe UI", 7, "bold"),
|
|
4847
|
-
width=
|
|
4847
|
+
width=102
|
|
4848
4848
|
)
|
|
4849
4849
|
self.audit_btn.pack(side=tk.LEFT, padx=3)
|
|
4850
4850
|
|
|
4851
|
+
self.agency_header_btn = CanvasPillButton(
|
|
4852
|
+
header_controls,
|
|
4853
|
+
text="🤖 AGENCY",
|
|
4854
|
+
command=self.open_agency_studio_dialog,
|
|
4855
|
+
height=28,
|
|
4856
|
+
radius=14,
|
|
4857
|
+
bg_color=PALETTE.get("card_hover", "#e0e7ff"),
|
|
4858
|
+
text_color=PALETTE.get("accent_green", "#10b981"),
|
|
4859
|
+
font=("Segoe UI", 7, "bold"),
|
|
4860
|
+
width=96
|
|
4861
|
+
)
|
|
4862
|
+
self.agency_header_btn.pack(side=tk.LEFT, padx=3)
|
|
4863
|
+
|
|
4851
4864
|
self.web_console_btn = CanvasPillButton(
|
|
4852
4865
|
header_controls,
|
|
4853
4866
|
text="🌐 WEB CONSOLE",
|
|
@@ -4857,7 +4870,7 @@ class AutoReadmeGUI:
|
|
|
4857
4870
|
bg_color=PALETTE["card_border"],
|
|
4858
4871
|
text_color=PALETTE.get("accent_cyan", "#38bdf8"),
|
|
4859
4872
|
font=("Segoe UI", 7, "bold"),
|
|
4860
|
-
width=
|
|
4873
|
+
width=108
|
|
4861
4874
|
)
|
|
4862
4875
|
self.web_console_btn.pack(side=tk.LEFT, padx=3)
|
|
4863
4876
|
|
|
@@ -4871,7 +4884,7 @@ class AutoReadmeGUI:
|
|
|
4871
4884
|
hover_color="#fb7185",
|
|
4872
4885
|
text_color="#fb7185" if PALETTE.get("bg_start") != "#edf2fb" else "#be123c",
|
|
4873
4886
|
font=("Segoe UI", 7, "bold"),
|
|
4874
|
-
width=
|
|
4887
|
+
width=92
|
|
4875
4888
|
)
|
|
4876
4889
|
self.sponsor_header_btn.pack(side=tk.LEFT, padx=3)
|
|
4877
4890
|
|
|
@@ -4884,7 +4897,7 @@ class AutoReadmeGUI:
|
|
|
4884
4897
|
bg_color=PALETTE.get("warning", "#eab308"),
|
|
4885
4898
|
text_color="#000000",
|
|
4886
4899
|
font=("Segoe UI", 7, "bold"),
|
|
4887
|
-
width=
|
|
4900
|
+
width=108
|
|
4888
4901
|
)
|
|
4889
4902
|
self.star_header_btn.pack(side=tk.LEFT, padx=3)
|
|
4890
4903
|
|
|
@@ -5635,14 +5648,27 @@ class AutoReadmeGUI:
|
|
|
5635
5648
|
q_inner,
|
|
5636
5649
|
text=get_text("scan_btn", self.lang),
|
|
5637
5650
|
command=self.run_scanner,
|
|
5638
|
-
height=
|
|
5639
|
-
radius=
|
|
5651
|
+
height=30,
|
|
5652
|
+
radius=15,
|
|
5640
5653
|
bg_color=PALETTE["sidebar_bg"],
|
|
5641
5654
|
hover_color=PALETTE["accent_purple"],
|
|
5642
5655
|
text_color="#ffffff",
|
|
5643
5656
|
font=("Segoe UI", 8, "bold")
|
|
5644
5657
|
)
|
|
5645
|
-
self.scan_btn.pack(fill=tk.X, pady=(2,
|
|
5658
|
+
self.scan_btn.pack(fill=tk.X, pady=(2, 4))
|
|
5659
|
+
|
|
5660
|
+
self.open_agency_btn = CanvasPillButton(
|
|
5661
|
+
q_inner,
|
|
5662
|
+
text="🤖 T-ZERO AGENCY (448 READMEs • SWARM)",
|
|
5663
|
+
command=self.open_agency_studio_dialog,
|
|
5664
|
+
height=28,
|
|
5665
|
+
radius=14,
|
|
5666
|
+
bg_color=PALETTE["card_border"],
|
|
5667
|
+
hover_color=PALETTE["accent_cyan"],
|
|
5668
|
+
text_color=PALETTE["accent_cyan"],
|
|
5669
|
+
font=("Segoe UI", 8, "bold")
|
|
5670
|
+
)
|
|
5671
|
+
self.open_agency_btn.pack(fill=tk.X, pady=(0, 0))
|
|
5646
5672
|
|
|
5647
5673
|
# --- ROW 2: Bottom Cards ---
|
|
5648
5674
|
# Card 7: Monthly Stacked Bar Card
|
|
@@ -7657,10 +7683,10 @@ class AutoReadmeGUI:
|
|
|
7657
7683
|
def setup_tab_generate(self):
|
|
7658
7684
|
f = self.tab_frames[3]
|
|
7659
7685
|
f.columnconfigure(0, weight=1)
|
|
7660
|
-
f.rowconfigure(
|
|
7686
|
+
f.rowconfigure(2, weight=1)
|
|
7661
7687
|
|
|
7662
7688
|
toolbar = GlassCard(f)
|
|
7663
|
-
toolbar.grid(row=0, column=0, sticky="ew", pady=(0,
|
|
7689
|
+
toolbar.grid(row=0, column=0, sticky="ew", pady=(0, 6))
|
|
7664
7690
|
toolbar.config(padx=15, pady=8)
|
|
7665
7691
|
|
|
7666
7692
|
self.gen_btn = apply_modern_hover(tk.Button(toolbar, text=get_text("generate_btn", self.lang), bg=PALETTE["accent_green"], fg="#000000", relief=tk.FLAT, font=("Segoe UI", 10, "bold"), command=self.start_generation, cursor="hand2"), hover_bg="#34d399", hover_fg="#000000")
|
|
@@ -7678,10 +7704,35 @@ class AutoReadmeGUI:
|
|
|
7678
7704
|
|
|
7679
7705
|
self.gen_status_lbl = tk.Label(toolbar, text="Ready", font=("Segoe UI", 9), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"])
|
|
7680
7706
|
self.gen_status_lbl.pack(side=tk.RIGHT)
|
|
7707
|
+
|
|
7708
|
+
# Agency 1-Click README & Squad Strip (448+ Blueprints)
|
|
7709
|
+
agency_bar = GlassCard(f)
|
|
7710
|
+
agency_bar.grid(row=1, column=0, sticky="ew", pady=(0, 8))
|
|
7711
|
+
agency_bar.config(padx=12, pady=6)
|
|
7712
|
+
|
|
7713
|
+
tk.Label(agency_bar, text="🤖 AGENCY README (448 Blueprints):", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_purple"], bg=PALETTE["card_bg"]).pack(side=tk.LEFT, padx=(0, 6))
|
|
7714
|
+
self.agency_bp_var = tk.StringVar(value="auto")
|
|
7715
|
+
bp_choices = ["auto", "mcp-server/launch-viral", "ai-agent-framework/launch-viral", "python-cli/developer-dx", "python-library/minimalist-zen", "fastapi-backend/enterprise-rfc", "nextjs-saas/launch-viral", "open-source-launch/bilingual-tr-en", "cybersecurity-tool/security-zero-trust"]
|
|
7716
|
+
try:
|
|
7717
|
+
from tzero.tzero_agency import README_BLUEPRINTS
|
|
7718
|
+
bp_choices = ["auto"] + sorted(README_BLUEPRINTS.keys())
|
|
7719
|
+
except Exception:
|
|
7720
|
+
pass
|
|
7721
|
+
self.agency_bp_combo = ttk.Combobox(agency_bar, textvariable=self.agency_bp_var, values=bp_choices, width=32)
|
|
7722
|
+
self.agency_bp_combo.pack(side=tk.LEFT, padx=(0, 8))
|
|
7723
|
+
|
|
7724
|
+
self.agency_readme_btn = apply_modern_hover(tk.Button(agency_bar, text="⚡ 1-Click Agency README", bg=PALETTE["card_border"], fg=PALETTE["accent_green"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=self.run_agency_readme_quick, cursor="hand2"), hover_bg=PALETTE["accent_green"], hover_fg="#000000")
|
|
7725
|
+
self.agency_readme_btn.pack(side=tk.LEFT, padx=3, ipady=2, ipadx=8)
|
|
7726
|
+
|
|
7727
|
+
self.agency_studio_btn = apply_modern_hover(tk.Button(agency_bar, text="🧭 Open Agency Studio (Squads & Skills)", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 8, "bold"), command=self.open_agency_studio_dialog, cursor="hand2"), hover_bg=PALETTE["accent_cyan"], hover_fg="#000000")
|
|
7728
|
+
self.agency_studio_btn.pack(side=tk.LEFT, padx=3, ipady=2, ipadx=8)
|
|
7729
|
+
|
|
7730
|
+
self.agency_hint_lbl = tk.Label(agency_bar, text="0 API key required • 24 Skills • 16 Subagents", font=("Segoe UI", 8), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"])
|
|
7731
|
+
self.agency_hint_lbl.pack(side=tk.RIGHT)
|
|
7681
7732
|
|
|
7682
7733
|
# Split pane in generate tab for raw markdown vs styled markdown preview
|
|
7683
7734
|
paned = tk.PanedWindow(f, orient=tk.HORIZONTAL, bg=PALETTE["bg_start"], bd=0, sashwidth=4, sashrelief=tk.FLAT)
|
|
7684
|
-
paned.grid(row=
|
|
7735
|
+
paned.grid(row=2, column=0, sticky="nsew")
|
|
7685
7736
|
|
|
7686
7737
|
raw_container = GlassCard(paned)
|
|
7687
7738
|
raw_container.rowconfigure(0, weight=1)
|
|
@@ -7712,7 +7763,7 @@ class AutoReadmeGUI:
|
|
|
7712
7763
|
paned.add(render_container, minsize=400)
|
|
7713
7764
|
|
|
7714
7765
|
bottom = GlassCard(f)
|
|
7715
|
-
bottom.grid(row=
|
|
7766
|
+
bottom.grid(row=3, column=0, sticky="ew", pady=(10, 0))
|
|
7716
7767
|
bottom.config(padx=10, pady=6)
|
|
7717
7768
|
|
|
7718
7769
|
self.copy_btn = apply_modern_hover(tk.Button(bottom, text=get_text("copy_btn", self.lang), bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=self.copy_clipboard, cursor="hand2"))
|
|
@@ -7762,6 +7813,406 @@ class AutoReadmeGUI:
|
|
|
7762
7813
|
self.log("Offline AST context tree synthesized successfully.")
|
|
7763
7814
|
self.show_toast("⚡ Local Offline AST Context (100% Free & Zero-Leak) compiled successfully!", "success")
|
|
7764
7815
|
|
|
7816
|
+
def run_agency_readme_quick(self, blueprint_id: Optional[str] = None):
|
|
7817
|
+
"""Generate a repo-grounded README using one of 448 T-Zero Agency blueprints."""
|
|
7818
|
+
play_sfx("click")
|
|
7819
|
+
target_dir = self.dir_entry.get().strip() or os.getcwd()
|
|
7820
|
+
if not os.path.isdir(target_dir):
|
|
7821
|
+
self._show_warning("Warning", "Choose an existing workspace folder first!")
|
|
7822
|
+
return
|
|
7823
|
+
|
|
7824
|
+
chosen_bp = (blueprint_id or (self.agency_bp_var.get() if hasattr(self, "agency_bp_var") else "auto")).strip() or "auto"
|
|
7825
|
+
self.gen_progress["value"] = 25
|
|
7826
|
+
self.gen_status_lbl.config(text=f"Agency profiling workspace ({chosen_bp})...")
|
|
7827
|
+
if hasattr(self, "agency_readme_btn"):
|
|
7828
|
+
self.agency_readme_btn.config(state=tk.DISABLED)
|
|
7829
|
+
|
|
7830
|
+
def worker():
|
|
7831
|
+
try:
|
|
7832
|
+
from tzero.tzero_agency import TZeroAgency
|
|
7833
|
+
res = TZeroAgency.generate_readme(project_dir=target_dir, blueprint_id=chosen_bp)
|
|
7834
|
+
self.safe_after(0, lambda r=res: self._on_agency_readme_done(r))
|
|
7835
|
+
except Exception as exc:
|
|
7836
|
+
err_msg = str(exc)
|
|
7837
|
+
self.safe_after(0, lambda m=err_msg: self._on_agency_readme_error(m))
|
|
7838
|
+
|
|
7839
|
+
threading.Thread(target=worker, daemon=True).start()
|
|
7840
|
+
|
|
7841
|
+
def _on_agency_readme_done(self, result: Dict[str, Any]):
|
|
7842
|
+
if hasattr(self, "agency_readme_btn"):
|
|
7843
|
+
self.agency_readme_btn.config(state=tk.NORMAL)
|
|
7844
|
+
bp = result["blueprint"]
|
|
7845
|
+
prof = result["profile"]
|
|
7846
|
+
self.preview_text.delete("1.0", tk.END)
|
|
7847
|
+
self.preview_text.insert(tk.END, result["markdown"])
|
|
7848
|
+
self.update_rendered_markdown_panel()
|
|
7849
|
+
self.gen_progress["value"] = 100
|
|
7850
|
+
self.gen_status_lbl.config(text=f"Agency README ready: {bp['blueprint_id']}")
|
|
7851
|
+
if hasattr(self, "agency_hint_lbl"):
|
|
7852
|
+
self.agency_hint_lbl.config(text=f"Detected: {prof['primary_domain']} ({prof['primary_language']}) • Used {bp['blueprint_id']}")
|
|
7853
|
+
self.log(f"Agency synthesized README using blueprint '{bp['blueprint_id']}' ({prof['total_files']} files).")
|
|
7854
|
+
self.show_toast(f"🤖 Agency README ready ({bp['blueprint_id']})", "success")
|
|
7855
|
+
|
|
7856
|
+
def _on_agency_readme_error(self, message: str):
|
|
7857
|
+
if hasattr(self, "agency_readme_btn"):
|
|
7858
|
+
self.agency_readme_btn.config(state=tk.NORMAL)
|
|
7859
|
+
self.gen_progress["value"] = 0
|
|
7860
|
+
self.gen_status_lbl.config(text="Agency README failed.")
|
|
7861
|
+
self._show_error("Agency Error", message)
|
|
7862
|
+
|
|
7863
|
+
def open_agency_studio_dialog(self, initial_tab: int = 0):
|
|
7864
|
+
"""Open the interactive T-Zero Agency Studio (448 READMEs, 24 Skills, 16 Subagent Templates)."""
|
|
7865
|
+
play_sfx("click")
|
|
7866
|
+
try:
|
|
7867
|
+
from tzero.tzero_agency import (
|
|
7868
|
+
AGENCY_SKILLS,
|
|
7869
|
+
README_BLUEPRINTS,
|
|
7870
|
+
README_DOMAINS,
|
|
7871
|
+
README_STYLES,
|
|
7872
|
+
SUBAGENT_TEMPLATES,
|
|
7873
|
+
TZeroAgency,
|
|
7874
|
+
list_readme_blueprints,
|
|
7875
|
+
)
|
|
7876
|
+
except Exception as exc:
|
|
7877
|
+
self._show_error("Agency Error", f"Could not load T-Zero Agency: {exc}")
|
|
7878
|
+
return
|
|
7879
|
+
|
|
7880
|
+
target_dir = self.dir_entry.get().strip() or os.getcwd()
|
|
7881
|
+
if not os.path.isdir(target_dir):
|
|
7882
|
+
target_dir = os.getcwd()
|
|
7883
|
+
|
|
7884
|
+
dialog = tk.Toplevel(self.root)
|
|
7885
|
+
if siber_akademi_icon:
|
|
7886
|
+
try:
|
|
7887
|
+
siber_akademi_icon.apply_window_icon(dialog)
|
|
7888
|
+
except Exception:
|
|
7889
|
+
pass
|
|
7890
|
+
dialog.title("🤖 T-Zero Agency Studio — 448 READMEs • 24 Skills • 16 Subagents")
|
|
7891
|
+
dialog.geometry("1040x700")
|
|
7892
|
+
dialog.configure(bg=PALETTE["bg_start"])
|
|
7893
|
+
dialog.transient(self.root)
|
|
7894
|
+
|
|
7895
|
+
root_pad = tk.Frame(dialog, bg=PALETTE["bg_start"], padx=14, pady=12)
|
|
7896
|
+
root_pad.pack(fill=tk.BOTH, expand=True)
|
|
7897
|
+
|
|
7898
|
+
# Top workspace intelligence banner
|
|
7899
|
+
top_bar = GlassCard(root_pad)
|
|
7900
|
+
top_bar.pack(fill=tk.X, pady=(0, 8))
|
|
7901
|
+
top_inner = tk.Frame(top_bar, bg=PALETTE["card_bg"], padx=12, pady=8)
|
|
7902
|
+
top_inner.pack(fill=tk.X)
|
|
7903
|
+
|
|
7904
|
+
tk.Label(
|
|
7905
|
+
top_inner,
|
|
7906
|
+
text=f"🤖 T-ZERO AGENCY STUDIO • {len(README_BLUEPRINTS)} README Blueprints • {len(AGENCY_SKILLS)} Skills • {len(SUBAGENT_TEMPLATES)} Subagent Templates",
|
|
7907
|
+
font=("Segoe UI", 10, "bold"),
|
|
7908
|
+
fg=PALETTE["accent_cyan"],
|
|
7909
|
+
bg=PALETTE["card_bg"],
|
|
7910
|
+
).pack(side=tk.LEFT)
|
|
7911
|
+
|
|
7912
|
+
profile_lbl = tk.Label(
|
|
7913
|
+
top_inner,
|
|
7914
|
+
text=f"Workspace: {os.path.basename(os.path.abspath(target_dir))} (profiling...)",
|
|
7915
|
+
font=("Segoe UI", 8, "bold"),
|
|
7916
|
+
fg=PALETTE["accent_green"],
|
|
7917
|
+
bg=PALETTE["card_bg"],
|
|
7918
|
+
)
|
|
7919
|
+
profile_lbl.pack(side=tk.RIGHT)
|
|
7920
|
+
|
|
7921
|
+
studio_tabs = ttk.Notebook(root_pad)
|
|
7922
|
+
studio_tabs.pack(fill=tk.BOTH, expand=True)
|
|
7923
|
+
|
|
7924
|
+
tab_readme = tk.Frame(studio_tabs, bg=PALETTE["bg_start"], padx=8, pady=8)
|
|
7925
|
+
tab_squad = tk.Frame(studio_tabs, bg=PALETTE["bg_start"], padx=8, pady=8)
|
|
7926
|
+
tab_skills = tk.Frame(studio_tabs, bg=PALETTE["bg_start"], padx=8, pady=8)
|
|
7927
|
+
studio_tabs.add(tab_readme, text=f"📄 {len(README_BLUEPRINTS)} README Blueprints")
|
|
7928
|
+
studio_tabs.add(tab_squad, text=f"🐝 Multi-Agent Squad ({len(SUBAGENT_TEMPLATES)})")
|
|
7929
|
+
studio_tabs.add(tab_skills, text=f"⚡ Agency Skills ({len(AGENCY_SKILLS)})")
|
|
7930
|
+
|
|
7931
|
+
# --- STUDIO TAB 1: 448 README BLUEPRINTS ---
|
|
7932
|
+
filter_row = tk.Frame(tab_readme, bg=PALETTE["bg_start"])
|
|
7933
|
+
filter_row.pack(fill=tk.X, pady=(0, 8))
|
|
7934
|
+
|
|
7935
|
+
tk.Label(filter_row, text="Domain:", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT, padx=(0, 4))
|
|
7936
|
+
dom_var = tk.StringVar(value="all")
|
|
7937
|
+
dom_combo = ttk.Combobox(filter_row, textvariable=dom_var, values=["all"] + [d["id"] for d in README_DOMAINS], state="readonly", width=20)
|
|
7938
|
+
dom_combo.pack(side=tk.LEFT, padx=(0, 8))
|
|
7939
|
+
|
|
7940
|
+
tk.Label(filter_row, text="Style:", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT, padx=(0, 4))
|
|
7941
|
+
sty_var = tk.StringVar(value="all")
|
|
7942
|
+
sty_combo = ttk.Combobox(filter_row, textvariable=sty_var, values=["all"] + [s["id"] for s in README_STYLES], state="readonly", width=20)
|
|
7943
|
+
sty_combo.pack(side=tk.LEFT, padx=(0, 8))
|
|
7944
|
+
|
|
7945
|
+
tk.Label(filter_row, text="Search:", font=("Segoe UI", 8, "bold"), fg=PALETTE["text_muted"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT, padx=(0, 4))
|
|
7946
|
+
rm_search_entry = tk.Entry(filter_row, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], insertbackground="#ffffff", relief=tk.FLAT, width=22)
|
|
7947
|
+
rm_search_entry.pack(side=tk.LEFT, ipady=3, padx=(0, 8))
|
|
7948
|
+
|
|
7949
|
+
rm_count_lbl = tk.Label(filter_row, text=f"Showing {len(README_BLUEPRINTS)} / {len(README_BLUEPRINTS)}", font=("Segoe UI", 8, "bold"), fg=PALETTE["accent_cyan"], bg=PALETTE["bg_start"])
|
|
7950
|
+
rm_count_lbl.pack(side=tk.RIGHT)
|
|
7951
|
+
|
|
7952
|
+
rm_paned = tk.PanedWindow(tab_readme, orient=tk.HORIZONTAL, bg=PALETTE["bg_start"], bd=0, sashwidth=4)
|
|
7953
|
+
rm_paned.pack(fill=tk.BOTH, expand=True, pady=(0, 8))
|
|
7954
|
+
|
|
7955
|
+
rm_list_frame = tk.Frame(rm_paned, bg=PALETTE["card_bg"])
|
|
7956
|
+
rm_listbox = tk.Listbox(rm_list_frame, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], selectbackground=PALETTE["sidebar_bg"], relief=tk.FLAT, bd=0, font=("Consolas", 9))
|
|
7957
|
+
rm_scroll = tk.Scrollbar(rm_list_frame, command=rm_listbox.yview)
|
|
7958
|
+
rm_listbox.config(yscrollcommand=rm_scroll.set)
|
|
7959
|
+
rm_listbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
|
|
7960
|
+
rm_scroll.pack(side=tk.RIGHT, fill=tk.Y)
|
|
7961
|
+
|
|
7962
|
+
rm_preview = tk.Text(rm_paned, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], insertbackground="#ffffff", relief=tk.FLAT, font=("Consolas", 9), wrap=tk.WORD)
|
|
7963
|
+
rm_paned.add(rm_list_frame, minsize=310)
|
|
7964
|
+
rm_paned.add(rm_preview, minsize=520)
|
|
7965
|
+
|
|
7966
|
+
filtered_bps: List[str] = []
|
|
7967
|
+
|
|
7968
|
+
def refresh_blueprints(_event=None):
|
|
7969
|
+
bps = list_readme_blueprints(domain=dom_var.get(), style=sty_var.get(), query=rm_search_entry.get())
|
|
7970
|
+
filtered_bps.clear()
|
|
7971
|
+
rm_listbox.delete(0, tk.END)
|
|
7972
|
+
for bp in bps:
|
|
7973
|
+
filtered_bps.append(bp.blueprint_id)
|
|
7974
|
+
rm_listbox.insert(tk.END, f"{bp.blueprint_id} | {bp.title}")
|
|
7975
|
+
rm_count_lbl.config(text=f"Showing {len(bps)} / {len(README_BLUEPRINTS)}")
|
|
7976
|
+
|
|
7977
|
+
def render_selected_bp(bp_id: str):
|
|
7978
|
+
rm_preview.delete("1.0", tk.END)
|
|
7979
|
+
rm_preview.insert("1.0", f"Generating README with '{bp_id}'...\n")
|
|
7980
|
+
|
|
7981
|
+
def work():
|
|
7982
|
+
try:
|
|
7983
|
+
res = TZeroAgency.generate_readme(project_dir=target_dir, blueprint_id=bp_id)
|
|
7984
|
+
self.safe_after(0, lambda r=res: (
|
|
7985
|
+
dialog.winfo_exists() and (
|
|
7986
|
+
rm_preview.delete("1.0", tk.END),
|
|
7987
|
+
rm_preview.insert("1.0", r["markdown"]),
|
|
7988
|
+
self.log(f"Agency Studio generated '{r['blueprint']['blueprint_id']}'."),
|
|
7989
|
+
)
|
|
7990
|
+
))
|
|
7991
|
+
except Exception as exc:
|
|
7992
|
+
self.safe_after(0, lambda m=str(exc): dialog.winfo_exists() and rm_preview.insert(tk.END, f"\n[ERROR] {m}"))
|
|
7993
|
+
|
|
7994
|
+
threading.Thread(target=work, daemon=True).start()
|
|
7995
|
+
|
|
7996
|
+
def on_generate_selected():
|
|
7997
|
+
sel = rm_listbox.curselection()
|
|
7998
|
+
bp_id = filtered_bps[sel[0]] if sel else "auto"
|
|
7999
|
+
render_selected_bp(bp_id)
|
|
8000
|
+
|
|
8001
|
+
def on_send_to_main():
|
|
8002
|
+
txt = rm_preview.get("1.0", tk.END).strip()
|
|
8003
|
+
if not txt:
|
|
8004
|
+
return
|
|
8005
|
+
self.preview_text.delete("1.0", tk.END)
|
|
8006
|
+
self.preview_text.insert(tk.END, txt)
|
|
8007
|
+
self.update_rendered_markdown_panel()
|
|
8008
|
+
self.switch_tab(3)
|
|
8009
|
+
self.show_toast("📥 Agency README loaded into Generate & Preview tab!", "success")
|
|
8010
|
+
|
|
8011
|
+
def on_save_readme_file():
|
|
8012
|
+
txt = rm_preview.get("1.0", tk.END).strip()
|
|
8013
|
+
if not txt:
|
|
8014
|
+
return
|
|
8015
|
+
out_path = filedialog.asksaveasfilename(
|
|
8016
|
+
initialdir=target_dir,
|
|
8017
|
+
initialfile="README.md",
|
|
8018
|
+
defaultextension=".md",
|
|
8019
|
+
filetypes=[("Markdown", "*.md"), ("All Files", "*.*")],
|
|
8020
|
+
)
|
|
8021
|
+
if out_path:
|
|
8022
|
+
with open(out_path, "w", encoding="utf-8") as fp:
|
|
8023
|
+
fp.write(txt + "\n")
|
|
8024
|
+
self.show_toast(f"💾 Saved README to {os.path.basename(out_path)}", "success")
|
|
8025
|
+
|
|
8026
|
+
dom_combo.bind("<<ComboboxSelected>>", refresh_blueprints)
|
|
8027
|
+
sty_combo.bind("<<ComboboxSelected>>", refresh_blueprints)
|
|
8028
|
+
rm_search_entry.bind("<KeyRelease>", refresh_blueprints)
|
|
8029
|
+
rm_listbox.bind("<Double-Button-1>", lambda _e: on_generate_selected())
|
|
8030
|
+
|
|
8031
|
+
rm_actions = tk.Frame(tab_readme, bg=PALETTE["bg_start"])
|
|
8032
|
+
rm_actions.pack(fill=tk.X)
|
|
8033
|
+
tk.Button(rm_actions, text="⚡ Auto-Best Match", bg=PALETTE["accent_green"], fg="#000000", relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=lambda: render_selected_bp("auto"), cursor="hand2").pack(side=tk.LEFT, padx=(0, 6), ipady=4, ipadx=10)
|
|
8034
|
+
tk.Button(rm_actions, text="▶ Generate Selected", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_generate_selected, cursor="hand2").pack(side=tk.LEFT, padx=4, ipady=4, ipadx=10)
|
|
8035
|
+
tk.Button(rm_actions, text="📥 Load in Main Preview", bg=PALETTE["card_border"], fg=PALETTE["accent_purple"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_send_to_main, cursor="hand2").pack(side=tk.LEFT, padx=4, ipady=4, ipadx=10)
|
|
8036
|
+
tk.Button(rm_actions, text="💾 Save As...", bg=PALETTE["card_border"], fg=PALETTE["text_main"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_save_readme_file, cursor="hand2").pack(side=tk.RIGHT, ipady=4, ipadx=10)
|
|
8037
|
+
|
|
8038
|
+
refresh_blueprints()
|
|
8039
|
+
|
|
8040
|
+
# --- STUDIO TAB 2: MULTI-AGENT SQUAD & 16 SUBAGENTS ---
|
|
8041
|
+
sq_top = tk.Frame(tab_squad, bg=PALETTE["bg_start"])
|
|
8042
|
+
sq_top.pack(fill=tk.X, pady=(0, 6))
|
|
8043
|
+
tk.Label(sq_top, text="Task / Goal (EN or TR):", font=("Segoe UI", 9, "bold"), fg=PALETTE["accent_cyan"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT, padx=(0, 6))
|
|
8044
|
+
goal_entry = tk.Entry(sq_top, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], insertbackground="#ffffff", relief=tk.FLAT, font=("Segoe UI", 9))
|
|
8045
|
+
goal_entry.pack(side=tk.LEFT, fill=tk.X, expand=True, ipady=4, padx=(0, 8))
|
|
8046
|
+
goal_entry.insert(0, "Analyze codebase structure, prepare README, security & test plan")
|
|
8047
|
+
|
|
8048
|
+
sq_presets = tk.Frame(tab_squad, bg=PALETTE["bg_start"])
|
|
8049
|
+
sq_presets.pack(fill=tk.X, pady=(0, 8))
|
|
8050
|
+
for label, preset_goal in (
|
|
8051
|
+
("📄 README + Docs", "Analyze project architecture and synthesize optimal README & docs"),
|
|
8052
|
+
("🛡️ Security & Zero-Leak", "Run zero-leak secret audit, boundary checks, and supply-chain verification"),
|
|
8053
|
+
("🔌 API + Tests", "Map API/MCP endpoints, check types, and build test coverage plan"),
|
|
8054
|
+
("🧹 Refactor & Debt", "Find duplicate blocks, dead code, complexity hotspots, and plan cleanup"),
|
|
8055
|
+
("🚀 Release Readiness", "Verify CI workflows, version sync, tests, and release readiness"),
|
|
8056
|
+
):
|
|
8057
|
+
tk.Button(
|
|
8058
|
+
sq_presets,
|
|
8059
|
+
text=label,
|
|
8060
|
+
bg=PALETTE["card_border"],
|
|
8061
|
+
fg=PALETTE["text_main"],
|
|
8062
|
+
relief=tk.FLAT,
|
|
8063
|
+
font=("Segoe UI", 8),
|
|
8064
|
+
cursor="hand2",
|
|
8065
|
+
command=lambda g=preset_goal: (goal_entry.delete(0, tk.END), goal_entry.insert(0, g)),
|
|
8066
|
+
).pack(side=tk.LEFT, padx=3)
|
|
8067
|
+
|
|
8068
|
+
sq_paned = tk.PanedWindow(tab_squad, orient=tk.HORIZONTAL, bg=PALETTE["bg_start"], bd=0, sashwidth=4)
|
|
8069
|
+
sq_paned.pack(fill=tk.BOTH, expand=True, pady=(0, 8))
|
|
8070
|
+
|
|
8071
|
+
sq_list_frame = tk.Frame(sq_paned, bg=PALETTE["card_bg"])
|
|
8072
|
+
sq_listbox = tk.Listbox(sq_list_frame, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], selectbackground=PALETTE["sidebar_bg"], relief=tk.FLAT, bd=0, font=("Consolas", 9))
|
|
8073
|
+
for tmpl in SUBAGENT_TEMPLATES:
|
|
8074
|
+
sq_listbox.insert(tk.END, f"[W{tmpl.wave}|{tmpl.tier}] {tmpl.role_name}")
|
|
8075
|
+
sq_listbox.pack(fill=tk.BOTH, expand=True)
|
|
8076
|
+
|
|
8077
|
+
sq_output = tk.Text(sq_paned, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], insertbackground="#ffffff", relief=tk.FLAT, font=("Consolas", 9), wrap=tk.WORD)
|
|
8078
|
+
sq_paned.add(sq_list_frame, minsize=290)
|
|
8079
|
+
sq_paned.add(sq_output, minsize=540)
|
|
8080
|
+
|
|
8081
|
+
def on_inspect_template(_e=None):
|
|
8082
|
+
sel = sq_listbox.curselection()
|
|
8083
|
+
if not sel:
|
|
8084
|
+
return
|
|
8085
|
+
tmpl = SUBAGENT_TEMPLATES[sel[0]]
|
|
8086
|
+
sq_output.delete("1.0", tk.END)
|
|
8087
|
+
sq_output.insert("1.0", tmpl.to_skill_markdown())
|
|
8088
|
+
|
|
8089
|
+
sq_listbox.bind("<<TreeviewSelect>>", on_inspect_template)
|
|
8090
|
+
sq_listbox.bind("<<ListboxSelect>>", on_inspect_template)
|
|
8091
|
+
|
|
8092
|
+
def on_run_squad():
|
|
8093
|
+
mission = goal_entry.get().strip() or "Full workspace analysis"
|
|
8094
|
+
sq_output.delete("1.0", tk.END)
|
|
8095
|
+
sq_output.insert("1.0", f"Assembling tailored subagent squad for: {mission}\n")
|
|
8096
|
+
|
|
8097
|
+
def work():
|
|
8098
|
+
try:
|
|
8099
|
+
res = TZeroAgency.run(goal=mission, project_dir=target_dir, generate_readme_flag=True)
|
|
8100
|
+
self.safe_after(0, lambda r=res: (
|
|
8101
|
+
dialog.winfo_exists() and (
|
|
8102
|
+
sq_output.delete("1.0", tk.END),
|
|
8103
|
+
sq_output.insert("1.0", r.summary_markdown),
|
|
8104
|
+
self.show_toast(f"🐝 Agency squad finished ({len(r.agent_reports)} agents in {r.elapsed_ms:.0f}ms)", "success"),
|
|
8105
|
+
)
|
|
8106
|
+
))
|
|
8107
|
+
except Exception as exc:
|
|
8108
|
+
self.safe_after(0, lambda m=str(exc): dialog.winfo_exists() and sq_output.insert(tk.END, f"\n[ERROR] {m}"))
|
|
8109
|
+
|
|
8110
|
+
threading.Thread(target=work, daemon=True).start()
|
|
8111
|
+
|
|
8112
|
+
def on_export_pack():
|
|
8113
|
+
try:
|
|
8114
|
+
exp = TZeroAgency.export_pack(project_dir=target_dir, goal=goal_entry.get().strip())
|
|
8115
|
+
self.show_toast(f"📦 Exported {exp['exported_count']} Agency files to .tzero/agency/", "success")
|
|
8116
|
+
sq_output.insert(tk.END, f"\n\n[EXPORTED] {exp['exported_count']} files -> {os.path.join(exp['workspace_dir'], '.tzero', 'agency')}\n")
|
|
8117
|
+
except Exception as exc:
|
|
8118
|
+
self._show_error("Export Error", str(exc))
|
|
8119
|
+
|
|
8120
|
+
sq_actions = tk.Frame(tab_squad, bg=PALETTE["bg_start"])
|
|
8121
|
+
sq_actions.pack(fill=tk.X)
|
|
8122
|
+
tk.Button(sq_actions, text="🚀 Analyze Structure & Run Squad", bg=PALETTE["accent_green"], fg="#000000", relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_run_squad, cursor="hand2").pack(side=tk.LEFT, padx=(0, 6), ipady=4, ipadx=12)
|
|
8123
|
+
tk.Button(sq_actions, text="📦 Export Squad & Skills (.tzero/agency/)", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_export_pack, cursor="hand2").pack(side=tk.LEFT, padx=4, ipady=4, ipadx=10)
|
|
8124
|
+
|
|
8125
|
+
# --- STUDIO TAB 3: 24 AGENCY SKILLS ---
|
|
8126
|
+
sk_top = tk.Frame(tab_skills, bg=PALETTE["bg_start"])
|
|
8127
|
+
sk_top.pack(fill=tk.X, pady=(0, 6))
|
|
8128
|
+
tk.Label(sk_top, text="Search Skills:", font=("Segoe UI", 9, "bold"), fg=PALETTE["accent_purple"], bg=PALETTE["bg_start"]).pack(side=tk.LEFT, padx=(0, 6))
|
|
8129
|
+
sk_search = tk.Entry(sk_top, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], insertbackground="#ffffff", relief=tk.FLAT, font=("Segoe UI", 9))
|
|
8130
|
+
sk_search.pack(side=tk.LEFT, fill=tk.X, expand=True, ipady=4)
|
|
8131
|
+
|
|
8132
|
+
sk_paned = tk.PanedWindow(tab_skills, orient=tk.HORIZONTAL, bg=PALETTE["bg_start"], bd=0, sashwidth=4)
|
|
8133
|
+
sk_paned.pack(fill=tk.BOTH, expand=True, pady=(0, 8))
|
|
8134
|
+
|
|
8135
|
+
sk_list_frame = tk.Frame(sk_paned, bg=PALETTE["card_bg"])
|
|
8136
|
+
sk_listbox = tk.Listbox(sk_list_frame, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], selectbackground=PALETTE["sidebar_bg"], relief=tk.FLAT, bd=0, font=("Consolas", 9))
|
|
8137
|
+
sk_listbox.pack(fill=tk.BOTH, expand=True)
|
|
8138
|
+
sk_preview = tk.Text(sk_paned, bg=PALETTE["card_bg"], fg=PALETTE["text_main"], insertbackground="#ffffff", relief=tk.FLAT, font=("Consolas", 9), wrap=tk.WORD)
|
|
8139
|
+
sk_paned.add(sk_list_frame, minsize=300)
|
|
8140
|
+
sk_paned.add(sk_preview, minsize=530)
|
|
8141
|
+
|
|
8142
|
+
visible_skills: List[Any] = []
|
|
8143
|
+
|
|
8144
|
+
def refresh_skills(_e=None):
|
|
8145
|
+
q = sk_search.get().strip().lower()
|
|
8146
|
+
visible_skills.clear()
|
|
8147
|
+
sk_listbox.delete(0, tk.END)
|
|
8148
|
+
for sk in AGENCY_SKILLS:
|
|
8149
|
+
if not q or q in sk.skill_id or q in sk.name.lower() or q in sk.summary.lower() or q in sk.category.lower():
|
|
8150
|
+
visible_skills.append(sk)
|
|
8151
|
+
sk_listbox.insert(tk.END, f"[{sk.tier}] {sk.skill_id} — {sk.category}")
|
|
8152
|
+
|
|
8153
|
+
def on_select_skill(_e=None):
|
|
8154
|
+
sel = sk_listbox.curselection()
|
|
8155
|
+
if not sel:
|
|
8156
|
+
return
|
|
8157
|
+
sk = visible_skills[sel[0]]
|
|
8158
|
+
sk_preview.delete("1.0", tk.END)
|
|
8159
|
+
sk_preview.insert("1.0", sk.to_skill_markdown())
|
|
8160
|
+
|
|
8161
|
+
def on_run_skill():
|
|
8162
|
+
sel = sk_listbox.curselection()
|
|
8163
|
+
if not sel:
|
|
8164
|
+
return
|
|
8165
|
+
sk = visible_skills[sel[0]]
|
|
8166
|
+
sk_preview.delete("1.0", tk.END)
|
|
8167
|
+
sk_preview.insert("1.0", f"Running skill '{sk.skill_id}'...\n")
|
|
8168
|
+
|
|
8169
|
+
def work():
|
|
8170
|
+
try:
|
|
8171
|
+
res = TZeroAgency.run_skill(sk.skill_id, project_dir=target_dir)
|
|
8172
|
+
self.safe_after(0, lambda r=res: dialog.winfo_exists() and (
|
|
8173
|
+
sk_preview.delete("1.0", tk.END),
|
|
8174
|
+
sk_preview.insert("1.0", r["markdown"]),
|
|
8175
|
+
))
|
|
8176
|
+
except Exception as exc:
|
|
8177
|
+
self.safe_after(0, lambda m=str(exc): dialog.winfo_exists() and sk_preview.insert(tk.END, f"\n[ERROR] {m}"))
|
|
8178
|
+
|
|
8179
|
+
threading.Thread(target=work, daemon=True).start()
|
|
8180
|
+
|
|
8181
|
+
def on_load_skill_to_workbench():
|
|
8182
|
+
txt = sk_preview.get("1.0", tk.END).strip()
|
|
8183
|
+
if not txt or not hasattr(self, "tmpl_text"):
|
|
8184
|
+
return
|
|
8185
|
+
self.tmpl_text.delete("1.0", tk.END)
|
|
8186
|
+
self.tmpl_text.insert("1.0", txt)
|
|
8187
|
+
self.update_prompt_playground_sandbox()
|
|
8188
|
+
self.switch_tab(4)
|
|
8189
|
+
self.show_toast("📥 Loaded into Prompt & Template Workbench!", "success")
|
|
8190
|
+
|
|
8191
|
+
sk_search.bind("<KeyRelease>", refresh_skills)
|
|
8192
|
+
sk_listbox.bind("<<ListboxSelect>>", on_select_skill)
|
|
8193
|
+
refresh_skills()
|
|
8194
|
+
|
|
8195
|
+
sk_actions = tk.Frame(tab_skills, bg=PALETTE["bg_start"])
|
|
8196
|
+
sk_actions.pack(fill=tk.X)
|
|
8197
|
+
tk.Button(sk_actions, text="▶ Run Selected Skill", bg=PALETTE["accent_green"], fg="#000000", relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_run_skill, cursor="hand2").pack(side=tk.LEFT, padx=(0, 6), ipady=4, ipadx=10)
|
|
8198
|
+
tk.Button(sk_actions, text="📥 Load into Template Workbench", bg=PALETTE["card_border"], fg=PALETTE["accent_purple"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_load_skill_to_workbench, cursor="hand2").pack(side=tk.LEFT, padx=4, ipady=4, ipadx=10)
|
|
8199
|
+
tk.Button(sk_actions, text="📤 Export All 24 Skills", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=on_export_pack, cursor="hand2").pack(side=tk.RIGHT, ipady=4, ipadx=10)
|
|
8200
|
+
|
|
8201
|
+
if 0 <= initial_tab <= 2:
|
|
8202
|
+
studio_tabs.select(initial_tab)
|
|
8203
|
+
|
|
8204
|
+
# Async initial profiling so dialog opens instantaneously
|
|
8205
|
+
def load_initial_profile():
|
|
8206
|
+
try:
|
|
8207
|
+
prof = TZeroAgency.profile(target_dir)
|
|
8208
|
+
self.safe_after(0, lambda p=prof: dialog.winfo_exists() and profile_lbl.config(
|
|
8209
|
+
text=f"{p.project_name} • {p.primary_language} • Domain: {p.primary_domain} • {p.total_files} files"
|
|
8210
|
+
))
|
|
8211
|
+
except Exception:
|
|
8212
|
+
pass
|
|
8213
|
+
|
|
8214
|
+
threading.Thread(target=load_initial_profile, daemon=True).start()
|
|
8215
|
+
|
|
7765
8216
|
def start_generation(self):
|
|
7766
8217
|
url = self.api_url_entry.get().strip()
|
|
7767
8218
|
key = self.api_key_entry.get().strip()
|
|
@@ -8150,6 +8601,9 @@ Custom Requirements:
|
|
|
8150
8601
|
self.optimize_prompt_btn = apply_modern_hover(tk.Button(toolbar, text="🧠 Optimize Prompts Heuristic", bg=PALETTE["card_border"], fg=PALETTE["accent_cyan"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=self.run_prompt_optimization_check, cursor="hand2"), hover_bg=PALETTE["accent_cyan"], hover_fg="#000000")
|
|
8151
8602
|
self.optimize_prompt_btn.pack(side=tk.LEFT, padx=5)
|
|
8152
8603
|
|
|
8604
|
+
self.agency_studio_tmpl_btn = apply_modern_hover(tk.Button(toolbar, text="🤖 Agency Studio (448 READMEs • Skills • Subagents)", bg=PALETTE["card_border"], fg=PALETTE["accent_purple"], relief=tk.FLAT, font=("Segoe UI", 9, "bold"), command=lambda: self.open_agency_studio_dialog(initial_tab=2), cursor="hand2"), hover_bg=PALETTE["accent_purple"], hover_fg="#ffffff")
|
|
8605
|
+
self.agency_studio_tmpl_btn.pack(side=tk.LEFT, padx=5)
|
|
8606
|
+
|
|
8153
8607
|
tk.Label(toolbar, text="Use tokens: {{PROJECT_NAME}}, {{MODULES_REFERENCE}}, {{HALLUCINATION_GUARDRAILS}}", font=("Segoe UI", 9), fg=PALETTE["text_muted"], bg=PALETTE["card_bg"]).pack(side=tk.RIGHT)
|
|
8154
8608
|
|
|
8155
8609
|
paned = tk.PanedWindow(f, orient=tk.HORIZONTAL, bg=PALETTE["bg_start"], bd=0, sashwidth=4, sashrelief=tk.FLAT)
|
|
@@ -9458,6 +9912,11 @@ def main():
|
|
|
9458
9912
|
run_system_disk_doctor(clean=True, workspace_dir=target_dir)
|
|
9459
9913
|
sys.exit(0)
|
|
9460
9914
|
|
|
9915
|
+
# Fast path for T-Zero Agency (448 README Blueprints, 24 Skills, 16 Subagent Templates)
|
|
9916
|
+
if len(sys.argv) > 1 and sys.argv[1].lower() in ("agency", "--agency", "-agency"):
|
|
9917
|
+
from tzero.tzero_agency import run_agency_cli
|
|
9918
|
+
sys.exit(run_agency_cli(sys.argv[2:]))
|
|
9919
|
+
|
|
9461
9920
|
parser = argparse.ArgumentParser(
|
|
9462
9921
|
description="Siber Akademi T-Zero Context Architect - Enterprise Codebase Context Builder & Token Reducer",
|
|
9463
9922
|
epilog="""
|
|
@@ -9553,7 +10012,7 @@ def main():
|
|
|
9553
10012
|
default="o200k_base", help="BPE encoding for --symbol-context")
|
|
9554
10013
|
parser.add_argument("--cache-aligned", action="store_true", help="Order context for KV-cache prefix stability (immutable static prefix before dynamic query suffix)")
|
|
9555
10014
|
parser.add_argument("--commit-msg", action="store_true", help="Generate Conventional Commit message from local AST git diff ($0 local engine)")
|
|
9556
|
-
parser.add_argument("--changelog", nargs="?", const="v12.3.
|
|
10015
|
+
parser.add_argument("--changelog", nargs="?", const="v12.3.7", default=None, metavar="VERSION", help="Generate release CHANGELOG markdown from git history")
|
|
9557
10016
|
parser.add_argument("--ci", choices=["github", "gitlab", "pre-commit", "local", "all"], default=None, help="Install CI/CD workflow or run local verification suite")
|
|
9558
10017
|
parser.add_argument("--local-ci", action="store_true", help="Run comprehensive Local CI & Pre-Push verification battery ($0 quota burn)")
|
|
9559
10018
|
parser.add_argument("--quick-ci", action="store_true", help="Run fast Local CI smoke checks in seconds")
|
|
@@ -9617,7 +10076,12 @@ def main():
|
|
|
9617
10076
|
parser.add_argument("--card", "--badge", nargs="?", const="assets/tzero_badge_card.svg", default=None, metavar="FILE", help="Generate viral dark-mode SVG banner card and GitHub README badges")
|
|
9618
10077
|
parser.add_argument("--showcase", nargs="?", const="tzero_showcase.html", default=None, metavar="FILE", help="Generate interactive split-screen HTML5 comparison showcase slider")
|
|
9619
10078
|
parser.add_argument("--marketing", "--growth", action="store_true", help="Launch $0-budget viral growth engine and export campaign materials for Reddit, HN, X, and Product Hunt")
|
|
9620
|
-
parser.add_argument("--
|
|
10079
|
+
parser.add_argument("--agency-readme", nargs="?", const="auto", default=None, metavar="BLUEPRINT", help="Generate repo-grounded README from 448 T-Zero Agency blueprints")
|
|
10080
|
+
parser.add_argument("--agency-skills", action="store_true", help="List all 24 T-Zero Agency built-in skills")
|
|
10081
|
+
parser.add_argument("--agency-templates", action="store_true", help="List all 16 T-Zero Agency subagent templates")
|
|
10082
|
+
parser.add_argument("--agency-export", action="store_true", help="Export Agency skills and subagent templates to .tzero/agency/")
|
|
10083
|
+
parser.add_argument("--agency-run", nargs="?", const="", default=None, metavar="GOAL", help="Run task-and-structure-aware T-Zero Agency multi-agent squad")
|
|
10084
|
+
parser.add_argument("--version", "-v", action="version", version="T-Zero Context Architect v12.3.7 Master Edition (engine v4.1.0)")
|
|
9621
10085
|
|
|
9622
10086
|
|
|
9623
10087
|
def print_master_tutorial():
|
|
@@ -9726,7 +10190,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9726
10190
|
def print_quickstart_guide():
|
|
9727
10191
|
print("""
|
|
9728
10192
|
================================================================================
|
|
9729
|
-
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP v12.3.
|
|
10193
|
+
⚡ SİBER AKADEMİ — T-ZERO CONTEXT ARCHITECT & MCP v12.3.7 MASTER (engine v4.1.0)
|
|
9730
10194
|
================================================================================
|
|
9731
10195
|
🎯 %95'e Varan Token Tasarrufu & Otonom Yapay Zeka Mimari Bağlam Motoru
|
|
9732
10196
|
|
|
@@ -9769,6 +10233,12 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
9769
10233
|
9️⃣ Hugging Face Space & Canlı Web Paneli:
|
|
9770
10234
|
$ tzero hf
|
|
9771
10235
|
|
|
10236
|
+
🤖 T-ZERO AGENCY (448 README Blueprints • 24 Skills • 16 Subagents):
|
|
10237
|
+
$ tzero agency # Yapıyı analiz et, en uygun ekip ve README öner
|
|
10238
|
+
$ tzero agency readme --out README.md # 448 şablondan en uygununu seçip README üret
|
|
10239
|
+
$ tzero agency run "API ve testleri kur" # Göreve özel çoklu ajan ekibini çalıştır
|
|
10240
|
+
$ tzero agency skills / templates / export # 24 skill & 16 subagent şablonunu dışa aktar
|
|
10241
|
+
|
|
9772
10242
|
🔬 v11 FRONTIER CAPABILITIES:
|
|
9773
10243
|
$ tzero --lsp # Zero-Leak Language Server (stdio JSON-RPC)
|
|
9774
10244
|
$ tzero --hook-install all # Install AI lifecycle hook guardrails
|
|
@@ -10682,7 +11152,7 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
10682
11152
|
if not os.path.exists(app_path):
|
|
10683
11153
|
app_path = os.path.join(os.getcwd(), "huggingface-space", "app.py")
|
|
10684
11154
|
print("\033[36m" + "=" * 80)
|
|
10685
|
-
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v12.3.
|
|
11155
|
+
print("🤗 SİBER AKADEMİ — T-ZERO HUGGING FACE SPACE & GRADIO COCKPIT (v12.3.7)")
|
|
10686
11156
|
print("=" * 80 + "\033[0m")
|
|
10687
11157
|
print("🌐 Official Live Space : https://huggingface.co/spaces/toprakke4/tzero-token-reducer")
|
|
10688
11158
|
print(f"📁 Local Application : {app_path}")
|
|
@@ -10823,6 +11293,40 @@ If this open-source tool helped you, please consider giving us a ⭐ on GitHub:
|
|
|
10823
11293
|
from tzero.tzero_growth import main as run_marketing
|
|
10824
11294
|
run_marketing()
|
|
10825
11295
|
sys.exit(0)
|
|
11296
|
+
elif getattr(args, "agency_readme", None) is not None:
|
|
11297
|
+
from tzero.tzero_agency import run_agency_cli
|
|
11298
|
+
cli_args = ["readme", args.agency_readme, "--dir", args.dir]
|
|
11299
|
+
if getattr(args, "output", None) and any(f in sys.argv for f in ("--out", "-o", "--output")):
|
|
11300
|
+
cli_args.extend(["--out", args.output])
|
|
11301
|
+
if getattr(args, "force", False):
|
|
11302
|
+
cli_args.append("--force")
|
|
11303
|
+
if getattr(args, "format", "text") == "json":
|
|
11304
|
+
cli_args.append("--json")
|
|
11305
|
+
sys.exit(run_agency_cli(cli_args))
|
|
11306
|
+
elif getattr(args, "agency_skills", False):
|
|
11307
|
+
from tzero.tzero_agency import run_agency_cli
|
|
11308
|
+
cli_args = ["skills", "--dir", args.dir]
|
|
11309
|
+
if getattr(args, "format", "text") == "json":
|
|
11310
|
+
cli_args.append("--json")
|
|
11311
|
+
sys.exit(run_agency_cli(cli_args))
|
|
11312
|
+
elif getattr(args, "agency_templates", False):
|
|
11313
|
+
from tzero.tzero_agency import run_agency_cli
|
|
11314
|
+
cli_args = ["templates", "--dir", args.dir]
|
|
11315
|
+
if getattr(args, "format", "text") == "json":
|
|
11316
|
+
cli_args.append("--json")
|
|
11317
|
+
sys.exit(run_agency_cli(cli_args))
|
|
11318
|
+
elif getattr(args, "agency_export", False):
|
|
11319
|
+
from tzero.tzero_agency import run_agency_cli
|
|
11320
|
+
cli_args = ["export", "--dir", args.dir]
|
|
11321
|
+
if getattr(args, "format", "text") == "json":
|
|
11322
|
+
cli_args.append("--json")
|
|
11323
|
+
sys.exit(run_agency_cli(cli_args))
|
|
11324
|
+
elif getattr(args, "agency_run", None) is not None:
|
|
11325
|
+
from tzero.tzero_agency import run_agency_cli
|
|
11326
|
+
cli_args = ["run", args.agency_run, "--dir", args.dir]
|
|
11327
|
+
if getattr(args, "format", "text") == "json":
|
|
11328
|
+
cli_args.append("--json")
|
|
11329
|
+
sys.exit(run_agency_cli(cli_args))
|
|
10826
11330
|
elif args.audit is not None:
|
|
10827
11331
|
run_audit_cli(args.audit or args.dir, output_format=getattr(args, "format", "text"))
|
|
10828
11332
|
elif args.export_agents is not None:
|