Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

Remove the legacy chatgpt-starter prototype

Federico Pereira0cf4466ae154
diff --git a/legacy/chatgpt-starter/Makefile b/legacy/chatgpt-starter/Makefile
deleted file mode 100644
index a6a198c..0000000
--- a/legacy/chatgpt-starter/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-CC ?= cc
-CFLAGS ?= -O2 -Wall -Wextra -Wpedantic -std=c11
-.PHONY: all clean
-all: build/lord-core
-build/lord-core: core/main.c
- mkdir -p build
- $(CC) $(CFLAGS) -o $@ $<
-clean:
- rm -rf build
diff --git a/legacy/chatgpt-starter/compositor-README.md b/legacy/chatgpt-starter/compositor-README.md
deleted file mode 100644
index a4f2963..0000000
--- a/legacy/chatgpt-starter/compositor-README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Future lord-compositor
-
-This directory is intentionally a design placeholder. Port the **matching wlroots 0.18.x tinywl** example and pin dependency versions. Do not call the current `core/main.c` a compositor.
diff --git a/legacy/chatgpt-starter/core/main.c b/legacy/chatgpt-starter/core/main.c
deleted file mode 100644
index 88a456d..0000000
--- a/legacy/chatgpt-starter/core/main.c
+++ /dev/null
@@ -1,58 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/types.h>
-#include <errno.h>
-
-static volatile sig_atomic_t running = 1;
-static char socket_path[sizeof(((struct sockaddr_un *)0)->sun_path)];
-static void on_signal(int sig) { (void)sig; running = 0; }
-
-typedef struct { int id, x, y; const char *title; } Window;
-static Window windows[] = {
- {1, 80, 95, "Files (demo)"},
- {2, 420, 180, "Terminal (demo)"}
-};
-
-static void respond(FILE *f, char *cmd) {
- int id, x, y;
- if (!strncmp(cmd,"LIST",4) && (cmd[4]=='\n'||cmd[4]=='\0')) {
- for (size_t i=0; i<sizeof(windows)/sizeof(windows[0]); i++)
- fprintf(f,"WINDOW %d %d %d %s\n",windows[i].id,windows[i].x,windows[i].y,windows[i].title);
- fputs("END\n",f);
- } else if (sscanf(cmd,"MOVE %d %d %d", &id,&x,&y)==3) {
- for(size_t i=0;i<sizeof(windows)/sizeof(windows[0]);i++)
- if(windows[i].id==id){ windows[i].x=x;windows[i].y=y;fputs("OK\n",f);fflush(f);return; }
- fputs("ERROR unknown-window\n",f);
- } else if(sscanf(cmd,"FOCUS %d",&id)==1) {
- int found=0;
- for(size_t i=0;i<sizeof(windows)/sizeof(windows[0]);i++) if(windows[i].id==id) found=1;
- fputs(found?"OK\n":"ERROR unknown-window\n",f);
- } else fputs("ERROR unknown-command\n",f);
- fflush(f);
-}
-
-int main(void) {
- signal(SIGINT,on_signal); signal(SIGTERM,on_signal);
- snprintf(socket_path,sizeof(socket_path),"/tmp/lordos-core-%lu.sock",(unsigned long)getuid());
- int s = socket(AF_UNIX, SOCK_STREAM, 0);
- if(s<0){perror("socket");return 1;}
- struct sockaddr_un addr={0};addr.sun_family=AF_UNIX;
- snprintf(addr.sun_path,sizeof(addr.sun_path),"%s",socket_path);
- unlink(socket_path);
- if(bind(s,(struct sockaddr*)&addr,sizeof(addr))<0){perror("bind");close(s);return 1;}
- if(listen(s,8)<0){perror("listen");close(s);unlink(socket_path);return 1;}
- fprintf(stderr,"LordOS demo IPC: %s\n",socket_path);
- while(running){
- int c=accept(s,NULL,NULL);
- if(c<0){if(errno==EINTR)continue;perror("accept");break;}
- FILE *f=fdopen(c,"r+");
- if(f){char line[256];if(fgets(line,sizeof(line),f)) respond(f,line);fclose(f);}else close(c);
- }
- close(s);unlink(socket_path);return 0;
-}
diff --git a/legacy/chatgpt-starter/desktop/index.html b/legacy/chatgpt-starter/desktop/index.html
deleted file mode 100644
index d7b5955..0000000
--- a/legacy/chatgpt-starter/desktop/index.html
+++ /dev/null
@@ -1 +0,0 @@
-<!doctype html><html lang="es"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>LordOS — Shell Prototype</title><link rel="stylesheet" href="style.css"></head><body><header class="top"><strong>♛ LordOS</strong><span>Debian 13 · Vista previa web</span><span id="clock"></span></header><main id="desktop"><div class="wall-title">LordOS <small>Desktop prototype / No Wayland compositor yet</small></div><section class="window" id="files" style="left:8%;top:17%;width:500px;height:310px"><div class="titlebar" data-drag="files"><b>▣ &nbsp;Archivos</b><div><button data-minimize="files" aria-label="Minimizar">−</button><button data-maximize="files" aria-label="Maximizar">□</button><button data-close="files" aria-label="Cerrar">×</button></div></div><div class="contents"><aside>⌂ Inicio<br>▣ Documentos<br>▣ Imágenes<br>▣ Descargas</aside><article><h3>Carpeta personal</h3><div class="folder-grid"><span>📁<small>Documentos</small></span><span>📁<small>Descargas</small></span><span>📁<small>Proyectos</small></span></div></article></div></section><section class="window" id="terminal" style="left:40%;top:30%;width:480px;height:270px"><div class="titlebar" data-drag="terminal"><b>❯ &nbsp;Terminal</b><div><button data-minimize="terminal" aria-label="Minimizar">−</button><button data-maximize="terminal" aria-label="Maximizar">□</button><button data-close="terminal" aria-label="Cerrar">×</button></div></div><div class="terminal"><span class="green">lord@debian:~$</span> echo 'Hello LordOS'<br>Hello LordOS<br><span class="green">lord@debian:~$</span> <span class="cursor">_</span><p>Terminal ilustrativa. No ejecuta comandos.</p></div></section></main><nav class="dock"><button data-open="files">▣ Archivos</button><button data-open="terminal">❯ Terminal</button><button id="about">ⓘ Acerca</button></nav><script src="main.js"></script></body></html>
diff --git a/legacy/chatgpt-starter/desktop/main.js b/legacy/chatgpt-starter/desktop/main.js
deleted file mode 100644
index 8255354..0000000
--- a/legacy/chatgpt-starter/desktop/main.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// LordOS desktop mockup; no native window integration yet.
-const windows = [...document.querySelectorAll('.window')];
-let z = 5;
-function focus(w) {w.style.zIndex = ++z;}
-function clock(){document.querySelector('#clock').textContent=new Date().toLocaleTimeString('es-AR',{hour:'2-digit',minute:'2-digit'});}
-clock();setInterval(clock,10000);
-windows.forEach(w=>w.addEventListener('pointerdown',()=>focus(w)));
-document.querySelectorAll('[data-open]').forEach(b=>b.addEventListener('click',()=>{const w=document.getElementById(b.dataset.open);w.style.display='flex';focus(w);}));
-document.querySelectorAll('[data-close]').forEach(b=>b.addEventListener('click',()=>document.getElementById(b.dataset.close).style.display='none'));
-document.querySelectorAll('[data-minimize]').forEach(b=>b.addEventListener('click',()=>document.getElementById(b.dataset.minimize).style.display='none'));
-document.querySelectorAll('[data-maximize]').forEach(b=>b.addEventListener('click',()=>{const w=document.getElementById(b.dataset.maximize); if(w.dataset.max){w.style.cssText=w.dataset.max;delete w.dataset.max;}else{w.dataset.max=w.style.cssText;w.style.left='15px';w.style.top='15px';w.style.width='calc(100% - 30px)';w.style.height='calc(100% - 95px)';}focus(w); }));
-document.querySelectorAll('[data-drag]').forEach(bar=>{
- bar.addEventListener('pointerdown',ev=>{
- if(ev.target.closest('button'))return;
- const w=document.getElementById(bar.dataset.drag),r=w.getBoundingClientRect(),d=document.querySelector('#desktop').getBoundingClientRect();
- let offsetX=ev.clientX-r.left,offsetY=ev.clientY-r.top;
- focus(w);bar.setPointerCapture(ev.pointerId);
- const move=e=>{w.style.left=Math.max(0,Math.min(d.width-w.offsetWidth,e.clientX-d.left-offsetX))+'px';w.style.top=Math.max(0,Math.min(d.height-w.offsetHeight,e.clientY-d.top-offsetY))+'px';};
- const end=()=>{bar.removeEventListener('pointermove',move);bar.removeEventListener('pointerup',end);bar.removeEventListener('pointercancel',end);};
- bar.addEventListener('pointermove',move);bar.addEventListener('pointerup',end);bar.addEventListener('pointercancel',end);
- });
-});
-document.querySelector('#about').addEventListener('click',()=>alert('LordOS Desktop Prototype — maqueta HTML/JS. Proximo hito: compositor Wayland real en Debian 13.'));
diff --git a/legacy/chatgpt-starter/desktop/style.css b/legacy/chatgpt-starter/desktop/style.css
deleted file mode 100644
index df35dfe..0000000
--- a/legacy/chatgpt-starter/desktop/style.css
+++ /dev/null
@@ -1 +0,0 @@
-:root{font-family:system-ui,Arial,sans-serif;color:#e6edff;background:#0b1222}*{box-sizing:border-box}body{margin:0;overflow:hidden}button{font:inherit;cursor:pointer}.top{height:44px;position:absolute;left:0;right:0;top:0;z-index:1000;background:#0b1425ee;border-bottom:1px solid #ffffff20;display:flex;align-items:center;justify-content:space-between;padding:0 20px;font-size:13px}.top strong{font-size:16px;color:#a8c4ff}#desktop{position:absolute;inset:44px 0 0;background:radial-gradient(ellipse at 65% 30%,#283b67 0,#121d38 52%,#080f20 100%)}.wall-title{position:absolute;left:5%;bottom:15%;font-size:56px;color:#eff4ff29;font-weight:800;letter-spacing:-4px;pointer-events:none}.wall-title small{display:block;font-weight:400;font-size:14px;letter-spacing:0;color:#b7c5e4a6}.window{position:absolute;min-width:260px;min-height:120px;border:1px solid #7586ae88;border-radius:12px;background:#121c30;box-shadow:0 22px 60px #0009;overflow:hidden;display:flex;flex-direction:column}.titlebar{height:42px;flex-shrink:0;display:flex;justify-content:space-between;align-items:center;padding:0 10px 0 15px;background:#253350;cursor:grab;user-select:none}.titlebar b{font-size:13px}.titlebar button{background:transparent;color:#dfe9ff;border:0;width:29px;height:28px;border-radius:6px}.titlebar button:hover{background:#ffffff24}.titlebar button:last-child:hover{background:#d75462}.contents{display:flex;flex:1;min-height:0}.contents aside{background:#17233a;line-height:2.8;min-width:145px;padding:14px;font-size:12px}.contents article{padding:20px;flex:1}.contents h3{margin:0 0 20px}.folder-grid{display:flex;gap:25px}.folder-grid span{font-size:31px;text-align:center}.folder-grid small{display:block;font-size:11px}.terminal{padding:18px;font:13px/1.8 ui-monospace,monospace;flex:1;background:#0d1526}.green{color:#85e6ba}.terminal p{color:#7e93bb;font-size:11px}.dock{position:absolute;bottom:19px;left:50%;transform:translateX(-50%);display:flex;gap:7px;padding:9px;border:1px solid #c9d9ff40;background:#111c32e8;backdrop-filter:blur(18px);border-radius:17px;z-index:999}.dock button{border:0;border-radius:10px;color:#ebf1ff;background:#334463;padding:11px 16px}.dock button:hover{background:#47628e}
diff --git a/legacy/chatgpt-starter/mcp/lord_mcp.py b/legacy/chatgpt-starter/mcp/lord_mcp.py
deleted file mode 100644
index 04f467e..0000000
--- a/legacy/chatgpt-starter/mcp/lord_mcp.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python3
-"""Minimal MCP stdio adapter for LordOS DEMO windows only. Python 3 stdlib."""
-import json
-import os
-import socket
-import sys
-
-PROTOCOL = "2025-06-18"
-TOOLS = [
- {"name": "lord_windows_list", "description": "List DEMO windows in LordOS starter; not actual Linux windows.", "inputSchema": {"type": "object", "properties": {}, "additionalProperties": False}},
- {"name": "lord_windows_move", "description": "Move a DEMO window in LordOS starter, not a native Linux surface.", "inputSchema": {"type": "object", "properties": {"id": {"type": "integer", "minimum": 1}, "x": {"type": "integer", "minimum": -10000, "maximum": 10000}, "y": {"type": "integer", "minimum": -10000, "maximum": 10000}}, "required": ["id", "x", "y"], "additionalProperties": False}},
-]
-
-def call_core(command):
- path = f"/tmp/lordos-core-{os.getuid()}.sock"
- with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
- s.settimeout(2)
- s.connect(path)
- s.sendall((command + "\n").encode())
- s.shutdown(socket.SHUT_WR)
- buf = bytearray()
- while len(buf) < 65536:
- part = s.recv(4096)
- if not part:
- break
- buf.extend(part)
- return buf.decode("utf-8", errors="replace")
-
-def handle(msg):
- method = msg.get("method")
- params = msg.get("params") or {}
- if method == "initialize":
- return {"protocolVersion": PROTOCOL, "capabilities": {"tools": {}}, "serverInfo": {"name": "lordos-starter-mcp", "version": "0.1.0"}}
- if method == "notifications/initialized":
- return None
- if method == "ping":
- return {}
- if method == "tools/list":
- return {"tools": TOOLS}
- if method == "tools/call":
- name = params.get("name")
- args = params.get("arguments") or {}
- try:
- if name == "lord_windows_list" and args == {}:
- command = "LIST"
- elif name == "lord_windows_move" and set(args) == {"id", "x", "y"} and all(type(args[k]) is int for k in ("id", "x", "y")) and args["id"] > 0 and all(-10000 <= args[k] <= 10000 for k in ("x", "y")):
- command = f"MOVE {args['id']} {args['x']} {args['y']}"
- else:
- return {"content": [{"type": "text", "text": "Invalid tool name or arguments"}], "isError": True}
- return {"content": [{"type": "text", "text": call_core(command)}]}
- except (OSError, UnicodeError) as e:
- return {"content": [{"type": "text", "text": f"Demo core unavailable: {e}"}], "isError": True}
- raise ValueError(f"Unsupported method: {method}")
-
-def main():
- for line in sys.stdin:
- msg = None
- try:
- msg = json.loads(line)
- if not isinstance(msg, dict):
- continue
- result = handle(msg)
- if "id" in msg:
- out = {"jsonrpc": "2.0", "id": msg["id"]}
- if result is None:
- out["result"] = {}
- else:
- out["result"] = result
- print(json.dumps(out, ensure_ascii=False), flush=True)
- except Exception as exc:
- if isinstance(msg, dict) and "id" in msg:
- print(json.dumps({"jsonrpc": "2.0", "id": msg["id"], "error": {"code": -32603, "message": str(exc)}}), flush=True)
-
-if __name__ == "__main__":
- main()
diff --git a/legacy/chatgpt-starter/scripts/ipc_client.py b/legacy/chatgpt-starter/scripts/ipc_client.py
deleted file mode 100644
index 72bcbcd..0000000
--- a/legacy/chatgpt-starter/scripts/ipc_client.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python3
-import os, socket, sys
-if len(sys.argv) < 2:
- sys.exit('Uso: python3 scripts/ipc_client.py list | move ID X Y | focus ID')
-command = sys.argv[1].lower()
-if command == 'list' and len(sys.argv) == 2:
- data = 'LIST\n'
-elif command == 'move' and len(sys.argv) == 5:
- data = f'MOVE {int(sys.argv[2])} {int(sys.argv[3])} {int(sys.argv[4])}\n'
-elif command == 'focus' and len(sys.argv) == 3:
- data = f'FOCUS {int(sys.argv[2])}\n'
-else:
- sys.exit('Argumentos invalidos')
-with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as sock:
- sock.connect(f'/tmp/lordos-core-{os.getuid()}.sock')
- sock.sendall(data.encode())
- sock.shutdown(socket.SHUT_WR)
- while True:
- piece = sock.recv(4096)
- if not piece: break
- print(piece.decode(), end='')
diff --git a/legacy/chatgpt-starter/sdk/wit/README.md b/legacy/chatgpt-starter/sdk/wit/README.md
deleted file mode 100644
index ad06799..0000000
--- a/legacy/chatgpt-starter/sdk/wit/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Lord SDK WIT (planned)
-
-WIT contracts are not stable yet. Proposed interfaces should use capability-based grants, versioning and strict boundaries. No native OS privileges are implicitly granted to WASM modules.
diff --git a/legacy/chatgpt-starter/wasm/examples/calculator/build.sh b/legacy/chatgpt-starter/wasm/examples/calculator/build.sh
deleted file mode 100755
index 0cfd0eb..0000000
--- a/legacy/chatgpt-starter/wasm/examples/calculator/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-set -eu
-cd "$(dirname "$0")"
-if ! command -v clang >/dev/null 2>&1; then
- echo 'Install clang with WebAssembly target support.' >&2
- exit 1
-fi
-clang --target=wasm32 -O2 -nostdlib -Wl,--no-entry -Wl,--export=add -Wl,--export=multiply -o calculator.wasm calculator.c
-echo 'Built calculator.wasm (load from JS WebAssembly.instantiate).'
diff --git a/legacy/chatgpt-starter/wasm/examples/calculator/calculator.c b/legacy/chatgpt-starter/wasm/examples/calculator/calculator.c
deleted file mode 100644
index dce223d..0000000
--- a/legacy/chatgpt-starter/wasm/examples/calculator/calculator.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// Freestanding WASM example: no file/network access and no dependencies.
-int add(int a, int b) { return a + b; }
-int multiply(int a, int b) { return a * b; }