Skip to content

Commit 3a0915b

Browse files
committed
chore: M5 CI/Workflow Sweep - final synchronisation
1 parent 01a888c commit 3a0915b

15 files changed

Lines changed: 1029 additions & 4 deletions

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
rust nightly
77
zig 0.15.2
88
idris2 0.7.0
9-
just 1.40.0
9+
just 1.46.0
1010
# nickel 1.10.0
1111
# gleam 1.8.0
1212
# elixir 1.18.0

play.sh

100644100755
File mode changed.

src/interface/abi/Foreign.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
||| @see GSA.ABI.Types for all type definitions
2222
||| @see GSA.ABI.Layout for memory layout proofs
2323

24-
module GSA.ABI.Foreign
24+
module Foreign
2525

2626
import GSA.ABI.Types
2727
import GSA.ABI.Layout

src/interface/abi/Layout.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
||| @see GSA.ABI.Types for the type definitions being verified
1919
||| @see GSA.ABI.Foreign for the FFI functions that use these layouts
2020

21-
module GSA.ABI.Layout
21+
module Layout
2222

2323
import GSA.ABI.Types
2424

src/interface/abi/Types.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
||| @see GSA.ABI.Foreign for FFI declarations using these types
1515
||| @see GSA.ABI.Layout for memory layout proofs of these types
1616

17-
module GSA.ABI.Types
17+
module Types
1818

1919
import Data.List
2020
import Data.List.Elem
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Game Server Admin — User Configuration Template
3+
#
4+
# This file defines user-specific settings including default server connections
5+
# and favorite servers. Copy this to user-config.ncl and customize.
6+
#
7+
# ⚠️ IMPORTANT: user-config.ncl is gitignored — it will never be committed.
8+
# This ensures your server credentials stay private.
9+
10+
{
11+
# Default server connection (used when no server is explicitly selected)
12+
default_server = {
13+
# Hostname or IP address of the default game server
14+
host = "localhost",
15+
16+
# Port number for the default game server
17+
port = 25565,
18+
19+
# Optional: Default game profile ID (matches profiles/*.a2ml id attribute)
20+
# profile_id = "minecraft-java",
21+
22+
# Optional: RCON password (if applicable)
23+
# rcon_password = "",
24+
},
25+
26+
# Favorite servers list
27+
# Each entry can be selected quickly from the UI
28+
favorites = [
29+
# Example favorite server configuration
30+
# {
31+
# name = "My Minecraft Server",
32+
# host = "mc.example.com",
33+
# port = 25565,
34+
# profile_id = "minecraft-java",
35+
# rcon_password = "",
36+
# },
37+
38+
# Add more favorites as needed
39+
# {
40+
# name = "My CS2 Server",
41+
# host = "cs2.example.com",
42+
# port = 27015,
43+
# profile_id = "csgo-cs2",
44+
# },
45+
],
46+
47+
# UI preferences
48+
ui = {
49+
# Theme: "light", "dark", or "system"
50+
theme = "system",
51+
52+
# Default panel to show on startup
53+
default_panel = "gsa-browser",
54+
55+
# Show advanced options by default
56+
show_advanced = false,
57+
},
58+
59+
# Connection settings
60+
connection = {
61+
# Timeout in milliseconds for server probes
62+
timeout_ms = 5000,
63+
64+
# Maximum retries for failed connections
65+
max_retries = 3,
66+
67+
# Enable verbose logging for troubleshooting
68+
verbose_logging = false,
69+
},
70+
71+
# VeriSimDB settings
72+
verisimdb = {
73+
# URL of the VeriSimDB instance
74+
url = "http://localhost:8090",
75+
76+
# Enable automatic data submission
77+
auto_submit = true,
78+
},
79+
}

src/ui/tea/gsa_gui.affine

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
// Game Server Admin (GSA) GUI — AffineScript TEA Interface
3+
// Underpinned by Cadre Router (Affine Stack Implementation)
4+
//
5+
// Purpose: Provide a formally verified, resource-safe interface for the
6+
// Universal game server probe, configuration management, and administration.
7+
8+
// ── Types ─────────────────────────────────────────────────────────────────
9+
10+
enum Panel {
11+
ServerBrowser,
12+
ConfigEditor,
13+
ServerActions,
14+
LiveLogs,
15+
HealthDashboard,
16+
ConfigHistory,
17+
CrossSearch
18+
}
19+
20+
enum ServerStatus {
21+
Running,
22+
Stopped,
23+
Starting,
24+
Stopping,
25+
Updating,
26+
Error(String)
27+
}
28+
29+
struct GameServer {
30+
id: String,
31+
display_name: String,
32+
game_id: String,
33+
host: String,
34+
port: Int,
35+
status: ServerStatus
36+
}
37+
38+
// ── Model ───────────────────────────────────────────────────────────────────
39+
40+
struct Model {
41+
current_panel: Panel,
42+
managed_servers: List(GameServer),
43+
selected_server_id: String,
44+
search_query: String,
45+
is_loading: Bool,
46+
history_depth: Int
47+
}
48+
49+
// ── Msg ──────────────────────────────────────────────────────────────────────
50+
51+
enum Msg {
52+
Navigate(Panel),
53+
SelectServer(String),
54+
UpdateSearch(String),
55+
ServerAction(String, String), // server_id, action
56+
RefreshServers,
57+
PopState
58+
}
59+
60+
// ── TEA Logic ────────────────────────────────────────────────────────────────
61+
62+
fn gsa_init() -> Model {
63+
{
64+
current_panel: Panel::ServerBrowser,
65+
managed_servers: [],
66+
selected_server_id: "",
67+
search_query: "",
68+
is_loading: false,
69+
history_depth: 0
70+
}
71+
}
72+
73+
fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
74+
match model {
75+
{ current_panel: p, managed_servers: s, selected_server_id: id, search_query: q, is_loading: l, history_depth: h } => {
76+
match msg {
77+
Navigate(new_panel) => {
78+
{
79+
current_panel: new_panel,
80+
managed_servers: s,
81+
selected_server_id: id,
82+
search_query: q,
83+
is_loading: false,
84+
history_depth: h + 1
85+
}
86+
}
87+
88+
SelectServer(new_id) => {
89+
{
90+
current_panel: p,
91+
managed_servers: s,
92+
selected_server_id: new_id,
93+
search_query: q,
94+
is_loading: l,
95+
history_depth: h
96+
}
97+
}
98+
99+
UpdateSearch(new_query) => {
100+
{
101+
current_panel: p,
102+
managed_servers: s,
103+
selected_server_id: id,
104+
search_query: new_query,
105+
is_loading: l,
106+
history_depth: h
107+
}
108+
}
109+
110+
ServerAction(sid, action) => {
111+
// This would trigger an FFI call via Command in a full impl
112+
{
113+
current_panel: p,
114+
managed_servers: s,
115+
selected_server_id: sid,
116+
search_query: q,
117+
is_loading: true,
118+
history_depth: h
119+
}
120+
}
121+
122+
RefreshServers => {
123+
{
124+
current_panel: p,
125+
managed_servers: s,
126+
selected_server_id: id,
127+
search_query: q,
128+
is_loading: true,
129+
history_depth: h
130+
}
131+
}
132+
133+
PopState => {
134+
if h > 0 {
135+
{
136+
current_panel: Panel::ServerBrowser,
137+
managed_servers: s,
138+
selected_server_id: "",
139+
search_query: q,
140+
is_loading: false,
141+
history_depth: h - 1
142+
}
143+
} else {
144+
{
145+
current_panel: p,
146+
managed_servers: s,
147+
selected_server_id: id,
148+
search_query: q,
149+
is_loading: l,
150+
history_depth: 0
151+
}
152+
}
153+
}
154+
}
155+
}
156+
}
157+
}
158+
159+
fn gsa_view(model: Model) -> String {
160+
match model.current_panel {
161+
ServerBrowser => "GAME HUB: Discovery & Lifecycle",
162+
ConfigEditor => "CONFIG EDITOR: " + model.selected_server_id,
163+
ServerActions => "SERVER ACTIONS: " + model.selected_server_id,
164+
LiveLogs => "LIVE LOGS: " + model.selected_server_id,
165+
HealthDashboard => "HEALTH DASHBOARD",
166+
ConfigHistory => "CONFIG HISTORY: " + model.selected_server_id,
167+
CrossSearch => "CROSS-SERVER SEARCH"
168+
}
169+
}
170+
171+
fn gsa_subs(model: Model) -> String {
172+
"None"
173+
}

src/wasm/Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
name = "gsa-wasm"
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["Game Server Admin <j.d.a.jewell@open.ac.uk>"]
6+
7+
[lib]
8+
crate-type = ["cdylib"]
9+
10+
[dependencies]
11+
wasm-bindgen = "0.2"
12+
serde = { version = "1.0", features = ["derive"] }
13+
serde_json = "1.0"
14+
serde-wasm-bindgen = "0.6"
15+
thiserror = "2.0"
16+
js-sys = "0.3"
17+
18+
# Network dependencies for server probing
19+
reqwest = { version = "0.11", features = ["json"] }
20+
tokio = { version = "1.0", features = ["full"] }
21+
22+
[features]
23+
default = []
24+
25+
[profile.release]
26+
opt-level = "z" # Optimize for size
27+
lto = true # Link-time optimization
28+
codegen-units = 1 # Better optimization
29+
strip = true # Strip symbols

0 commit comments

Comments
 (0)