backend: separate App and server, add websocket endpoint, accept data directory command argument. initialize sqlalchemy database and models in new module. frontend: create backend class for managing ws connection, move ui to chat_screen, create scaffold chat and agent classes.

This commit is contained in:
Shivering Ocelot committed 2025-05-06 17:50:57 -05:00
1 parent 1e82796db1
commit 44f0b3589c
19 files changed
+936 -122

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
const WebSocket = require('ws');
const ws = new WebSocket('ws://localhost:5000/ws');
ws.on('open', function open() {
const packet = JSON.stringify({ username: "test-user", password: "123456" });
ws.send(packet);
runTest();
});
ws.on('message', function incoming(data) {
const jsonResponse = JSON.parse(data);
console.log(jsonResponse);
});
function runTest() {
const message = {
action: 'create-agent',
body: {
name: 'First Agent',
description: 'First agent does nothing',
kind: 'simple',
data: {}
},
};
ws.send(JSON.stringify(message)); // Send the create-agent message
}
+13
View File
@@ -0,0 +1,13 @@
const WebSocket = require('ws');
const ws = new WebSocket('ws://localhost:5000/ws');
ws.on('open', function open() {
const packet = JSON.stringify({ username: "test-user", password: "123456" });
ws.send(packet);
});
ws.on('message', function incoming(data) {
const jsonResponse = JSON.parse(data);
console.log(jsonResponse);
});
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
URL="http://localhost:5000/user/signup"
DATA='{"username":"test-user","email":"user@test.com","password":"123456"}'
RESPONSE=$(curl -s -X POST $URL -H "Content-Type: application/json" -d "$DATA")
echo $RESPONSE