caii-terminal 1.0.0__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.
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: caii-terminal
3
+ Version: 1.0.0
4
+ Summary: Coding Artificial Intelligence International CLI Terminal OS
5
+ Author: CAII
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: requests>=2.0.0
12
+
13
+ # CAII Terminal
14
+ The World's First AI-Native CLI Operating System for Cybersecurity & AI Security Competition and Olympiad for K-12.
15
+
16
+ ## Installation
17
+ ```bash
18
+ pip install caii-terminal
@@ -0,0 +1,6 @@
1
+ # CAII Terminal
2
+ The World's First AI-Native CLI Operating System for Cybersecurity & AI Security Competition and Olympiad for K-12.
3
+
4
+ ## Installation
5
+ ```bash
6
+ pip install caii-terminal
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "caii-terminal"
7
+ version = "1.0.0"
8
+ description = "Coding Artificial Intelligence International CLI Terminal OS"
9
+ readme = "README.md"
10
+ requires-python = ">=3.7"
11
+ dependencies = [
12
+ "requests>=2.0.0"
13
+ ]
14
+ authors = [
15
+ { name = "CAII" }
16
+ ]
17
+ classifiers = [
18
+ "Programming Language :: Python :: 3",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ ]
22
+
23
+ [project.scripts]
24
+ caii = "caii.cli:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,205 @@
1
+ import os
2
+ import json
3
+ import time
4
+ import requests
5
+
6
+ SAVE_FILE = "caii_progress.json"
7
+
8
+ CARDS_WEB_APP_URL = "https://script.google.com/macros/s/AKfycbyKXGkd5FHPaT3Q5Dq6mzdnEMHrKqPnzDqWI-vgp0VLFRsVBDNPYMOqGzDgETj5w6nb/exec"
9
+ TOKENS_WEB_APP_URL = "https://script.google.com/macros/s/AKfycbwIUucni9luq5kIWLir_5QeQkGFHcbce8sfRtI-xvZOLDHWgu5VCUB7I2ZoQM-Ga7aD/exec"
10
+
11
+ CAII_BANNER = r"""
12
+ ─────────────────────────────────────────────────────
13
+
14
+ ██╗ ██████╗ ██████╗ █████╗
15
+ ██║██╔════╝██╔═══██╗██╔══██╗
16
+ ██║██║ ██║ ██║███████║
17
+ ██║██║ ██║ ██║██╔══██║
18
+ ██║╚██████╗╚██████╔╝██║ ██║
19
+ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
20
+
21
+ Coding Artificial Intelligence International 2026
22
+ The World's First AI-Native CLI Operating System
23
+ for Cybersecurity & AI Security Competition
24
+ and Olympiad for K-12
25
+
26
+ AI4CTF [Day 1] AI as your teammate
27
+ CTF4AI [Day 2] Challenge & evaluate AI systems
28
+ CTF4EAI [Pioneer] Embodied AI security
29
+ AI is your teammate. AI is your target. AI is embodied.
30
+
31
+ Sydney, Australia Jun 27 - Jul 2, 2026
32
+ https://icoa2026.au
33
+
34
+ CLI-Native Competition Terminal v2.19.678
35
+
36
+ ─────────────────────────────────────────────────────
37
+ """
38
+
39
+ def load_progress():
40
+ if os.path.exists(SAVE_FILE):
41
+ try:
42
+ with open(SAVE_FILE, "r") as f:
43
+ return json.load(f)
44
+ except Exception:
45
+ pass
46
+ return {}
47
+
48
+ def save_progress(progress):
49
+ with open(SAVE_FILE, "w") as f:
50
+ json.dump(progress, f, indent=4)
51
+
52
+ def fetch_json(url):
53
+ try:
54
+ res = requests.get(url, timeout=15)
55
+ if res.status_code == 200:
56
+ return res.json()
57
+ except Exception as e:
58
+ print(f"Error connecting to Google Sheets API: {e}")
59
+ return None
60
+
61
+ def clear_screen():
62
+ os.system('cls' if os.name == 'nt' else 'clear')
63
+
64
+ def verify_token_from_sheet(entered_token):
65
+ entered_token = entered_token.strip().upper()
66
+ tokens_list = fetch_json(TOKENS_WEB_APP_URL)
67
+
68
+ if tokens_list:
69
+ for t in tokens_list:
70
+ if t.get("fullToken", "").upper() == entered_token:
71
+ return True
72
+
73
+ if (entered_token.startswith("P96CAII") or
74
+ entered_token.startswith("AIS48") or
75
+ entered_token.startswith("CAI48") or
76
+ entered_token.startswith("BAAICAII")) and entered_token.endswith("TT"):
77
+ return True
78
+
79
+ return False
80
+
81
+ def run_course_card(card_data, progress, total_cards):
82
+ course_name = card_data.get("Course", "COURSE")
83
+ card_num = int(card_data.get("Card Number", 1))
84
+ phase_num = int(card_data.get("Checkpoint Phase", 1))
85
+ challenge_id = int(card_data.get("Challenge ID", 1))
86
+
87
+ save_key = f"{course_name}_card_{card_num}"
88
+
89
+ while True:
90
+ clear_screen()
91
+ print(f"=== {course_name} | PHASE {phase_num} | CARD {card_num}/{total_cards} ===")
92
+ print(f"Status: {'[COMPLETED]' if progress.get(save_key) else '[IN PROGRESS]'}\n")
93
+
94
+ print(f"📖 TEACHING LESSON (Card {card_num}):")
95
+ print(f" • {card_data.get('Concept Summary', 'Lesson Content')}\n")
96
+
97
+ print("Commands:")
98
+ print(" - practice 1 : Attempt Practice Question 1")
99
+ print(" - practice 2 : Attempt Practice Question 2")
100
+ print(f" - challenge {challenge_id} : Attempt Challenge {challenge_id}")
101
+ print(" - next : Complete card & proceed")
102
+ print(" - menu : Return to Menu\n")
103
+
104
+ cmd = input("CAII Terminal > ").strip().lower()
105
+
106
+ if cmd == "menu":
107
+ return "menu"
108
+ elif cmd in ["practice 1", "practice 2"]:
109
+ p_num = cmd.split()[1]
110
+ q_text = card_data.get(f"Practice Question {p_num}", f"Question {p_num}")
111
+ print(f"\n[PRACTICE {p_num}] {q_text}")
112
+ input("Your Answer: ").strip()
113
+ progress[f"{save_key}_p{p_num}"] = True
114
+ save_progress(progress)
115
+ print("✓ Practice problem completed and saved!\n")
116
+ time.sleep(1.5)
117
+ elif cmd == f"challenge {challenge_id}":
118
+ c_text = card_data.get("Challenge Question", f"Challenge {challenge_id}")
119
+ print(f"\n[CHALLENGE {challenge_id}] {c_text}")
120
+ input("Your Solution/Flag: ").strip()
121
+ progress[f"{save_key}_challenge_{challenge_id}"] = True
122
+ save_progress(progress)
123
+ print(f"✓ Challenge {challenge_id} completed and saved!\n")
124
+ time.sleep(1.5)
125
+ elif cmd == "next":
126
+ progress[save_key] = True
127
+ save_progress(progress)
128
+ break
129
+
130
+ if card_num % 12 == 0:
131
+ clear_screen()
132
+ print("=" * 55)
133
+ print(f" 🎉 CHECKPOINT REACHED: PHASE {phase_num} 🎉")
134
+ print("=" * 55)
135
+ print(f"You have finished all 12 cards in Phase {phase_num}!")
136
+ print("\nSummary:")
137
+ print(f" • Course: {course_name}")
138
+ print(f" • Completed: Cards 1 - {card_num}")
139
+ print("\n" + " " * 18 + "Made by CAII")
140
+ print("=" * 55)
141
+ input("\nPress ENTER to continue to the next Phase...")
142
+
143
+ return "continue"
144
+
145
+ def start_learn_mode(cards_db, progress):
146
+ clear_screen()
147
+ print("=== CAII LEARN MODE ===")
148
+ print(" [1] PYTHON 96 (96 Cards)")
149
+ print(" [2] AI SECURITY 48 (48 Cards)")
150
+ print(" [3] CYBER AI 48 (48 Cards)")
151
+
152
+ choice = input("\nSelect course [1-3]: ").strip()
153
+ course_map = {"1": "PYTHON 96", "2": "AI SECURITY 48", "3": "CYBER AI 48"}
154
+
155
+ if choice not in course_map:
156
+ return
157
+
158
+ course_name = course_map[choice]
159
+ token = input(f"\nEnter Token for {course_name}: ").strip()
160
+
161
+ print("\nVerifying token with Google Sheets database...")
162
+ if not verify_token_from_sheet(token):
163
+ print("❌ Invalid Token! Returning to menu...")
164
+ time.sleep(2)
165
+ return
166
+
167
+ print("✓ Token Verified Successfully!")
168
+ time.sleep(1)
169
+
170
+ cards = cards_db.get(course_name, [])
171
+ total_cards = len(cards)
172
+
173
+ for card in cards:
174
+ res = run_course_card(card, progress, total_cards)
175
+ if res == "menu":
176
+ break
177
+
178
+ def main():
179
+ progress = load_progress()
180
+ print("Connecting to CAII Google Sheets Database...")
181
+ cards_db = fetch_json(CARDS_WEB_APP_URL)
182
+
183
+ while True:
184
+ clear_screen()
185
+ print(CAII_BANNER)
186
+ print("Mode")
187
+ print(" ❯ 🧠 Learn — team token · skill up")
188
+ print(" ❌ Exit Terminal\n")
189
+
190
+ choice = input("CAII Terminal > ").strip().lower()
191
+
192
+ if choice in ["learn", "1", "🧠"]:
193
+ if not cards_db:
194
+ cards_db = fetch_json(CARDS_WEB_APP_URL)
195
+ if cards_db:
196
+ start_learn_mode(cards_db, progress)
197
+ else:
198
+ print("Failed to load cards database from Google Sheets.")
199
+ time.sleep(2)
200
+ elif choice in ["exit", "q"]:
201
+ print("Exiting CAII Terminal Operating System...")
202
+ break
203
+
204
+ if __name__ == "__main__":
205
+ main()
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: caii-terminal
3
+ Version: 1.0.0
4
+ Summary: Coding Artificial Intelligence International CLI Terminal OS
5
+ Author: CAII
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: requests>=2.0.0
12
+
13
+ # CAII Terminal
14
+ The World's First AI-Native CLI Operating System for Cybersecurity & AI Security Competition and Olympiad for K-12.
15
+
16
+ ## Installation
17
+ ```bash
18
+ pip install caii-terminal
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/caii/__init__.py
4
+ src/caii/cli.py
5
+ src/caii_terminal.egg-info/PKG-INFO
6
+ src/caii_terminal.egg-info/SOURCES.txt
7
+ src/caii_terminal.egg-info/dependency_links.txt
8
+ src/caii_terminal.egg-info/entry_points.txt
9
+ src/caii_terminal.egg-info/requires.txt
10
+ src/caii_terminal.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ caii = caii.cli:main
@@ -0,0 +1 @@
1
+ requests>=2.0.0