omnibot3000 1.10.4 → 1.10.6
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/TODO.md +1 -0
- package/api/server.ts +11 -0
- package/package.json +6 -6
- package/src/features/version/Version.tsx +1 -5
- package/vite.config.ts +3 -1
- package/.github/workflows/keep_alive.yml +0 -13
package/TODO.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
- randomize _Game of Life_ lifeforms angle by 90° steps
|
|
17
17
|
- try to color text with [rasterbars](https://en.wikipedia.org/wiki/Raster_bar)
|
|
18
18
|
- add links to [npmjs.com package](https://www.npmjs.com) on the /version page
|
|
19
|
+
- display time spent to return API response
|
|
19
20
|
|
|
20
21
|
## Done
|
|
21
22
|
|
package/api/server.ts
CHANGED
|
@@ -82,6 +82,8 @@ const getFolderSize = (folder: string): number => {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
const server = createServer((req: IncomingMessage, res: ServerResponse) => {
|
|
85
|
+
const requestStartedAt = performance.now();
|
|
86
|
+
|
|
85
87
|
/* CORS headers */
|
|
86
88
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
87
89
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
@@ -234,6 +236,15 @@ const server = createServer((req: IncomingMessage, res: ServerResponse) => {
|
|
|
234
236
|
res.writeHead(500, {"Content-Type": "application/json"});
|
|
235
237
|
res.end(JSON.stringify({error: message}));
|
|
236
238
|
}
|
|
239
|
+
} else if (url.startsWith(`${API_PATH}/ping`)) {
|
|
240
|
+
res.writeHead(200, {"Content-Type": "application/json"});
|
|
241
|
+
res.end(
|
|
242
|
+
JSON.stringify({
|
|
243
|
+
status: "ok",
|
|
244
|
+
rendertime:
|
|
245
|
+
Math.round((performance.now() - requestStartedAt) * 100) / 100,
|
|
246
|
+
}),
|
|
247
|
+
);
|
|
237
248
|
} else {
|
|
238
249
|
res.writeHead(404);
|
|
239
250
|
res.end("nothing to see here");
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"x-display-name": "OMNIBOT 3000",
|
|
4
4
|
"description": "your omniscient source of truth",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "1.10.
|
|
6
|
+
"version": "1.10.6",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "rez",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"omnibot": "./bin/omnibot.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@mistralai/mistralai": "^2.2.
|
|
22
|
+
"@mistralai/mistralai": "^2.2.6",
|
|
23
23
|
"dotenv": "^17.4.2",
|
|
24
|
-
"openai": "^6.
|
|
24
|
+
"openai": "^6.43.0",
|
|
25
25
|
"react": "^19.2.7",
|
|
26
26
|
"react-dom": "^19.2.7",
|
|
27
27
|
"react-markdown": "^10.1.0",
|
|
28
|
-
"react-router-dom": "^7.
|
|
28
|
+
"react-router-dom": "^7.18.0",
|
|
29
29
|
"zustand": "^5.0.14"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
43
43
|
"globals": "^17.6.0",
|
|
44
44
|
"husky": "^9.1.7",
|
|
45
|
-
"knip": "^6.
|
|
45
|
+
"knip": "^6.17.1",
|
|
46
46
|
"nodemon": "^3.1.14",
|
|
47
47
|
"npm-run-all": "^4.1.5",
|
|
48
48
|
"prettier": "^3.8.4",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"stylelint": "^17.13.0",
|
|
51
51
|
"stylelint-config-standard": "^40.0.0",
|
|
52
52
|
"typescript": "^6.0.3",
|
|
53
|
-
"typescript-eslint": "^8.61.
|
|
53
|
+
"typescript-eslint": "^8.61.1",
|
|
54
54
|
"vite": "^8.0.16"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
@@ -14,8 +14,6 @@ import styles from "@version/Version.module.css";
|
|
|
14
14
|
|
|
15
15
|
import cls from "classnames";
|
|
16
16
|
|
|
17
|
-
const API_PORT = Number(import.meta.env.API_PORT) || 3001;
|
|
18
|
-
|
|
19
17
|
interface Package {
|
|
20
18
|
name: string;
|
|
21
19
|
version: [number, number, number];
|
|
@@ -23,8 +21,6 @@ interface Package {
|
|
|
23
21
|
error?: string[];
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
export const PACKAGES_API = `${window.location.origin}:${API_PORT}${API_PATH}/packages`;
|
|
27
|
-
|
|
28
24
|
const Version = () => {
|
|
29
25
|
const chatStore = useChatCompletionStore();
|
|
30
26
|
|
|
@@ -34,7 +30,7 @@ const Version = () => {
|
|
|
34
30
|
const [loading, setLoading] = useState<boolean>(false);
|
|
35
31
|
|
|
36
32
|
const getResponse = async () => {
|
|
37
|
-
const data = await fetch(
|
|
33
|
+
const data = await fetch(`${API_PATH}/packages`);
|
|
38
34
|
|
|
39
35
|
if (data.status !== 200) {
|
|
40
36
|
const error = JSON.parse(await data.text()).error;
|
package/vite.config.ts
CHANGED
|
@@ -14,12 +14,14 @@ export default defineConfig(({mode}) => {
|
|
|
14
14
|
]);
|
|
15
15
|
|
|
16
16
|
console.info(
|
|
17
|
-
"\n\x1b[1m\x1b[32m%s\x1b[0m %s \x1b[32m%s\x1b[0m %s \x1b[36m%s\x1b[0m",
|
|
17
|
+
"\n\x1b[1m\x1b[32m%s\x1b[0m %s \x1b[32m%s\n\n \x1b[0m %s \x1b[36m%s\n \x1b[0m %s \x1b[36m%s\x1b[0m",
|
|
18
18
|
"→",
|
|
19
19
|
"Running",
|
|
20
20
|
`${pkg["x-display-name"]} v${pkg.version}`,
|
|
21
21
|
"dev server at",
|
|
22
22
|
`http://${env.DOMAIN}:${env.DEV_PORT}`,
|
|
23
|
+
"API server at",
|
|
24
|
+
`${env.API_PATH}:${env.API_PORT}`,
|
|
23
25
|
);
|
|
24
26
|
|
|
25
27
|
return {
|