@elizaos/app 1.0.0-alpha.33
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/.vscode/extensions.json +3 -0
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/index.html +31 -0
- package/package.json +35 -0
- package/public/tauri.svg +6 -0
- package/public/vite.svg +1 -0
- package/src/main.tsx +163 -0
- package/src/vite-env.d.ts +1 -0
- package/src-tauri/Cargo.lock +5433 -0
- package/src-tauri/Cargo.toml +27 -0
- package/src-tauri/build.rs +3 -0
- package/src-tauri/capabilities/default.json +10 -0
- package/src-tauri/icons/128x128.png +0 -0
- package/src-tauri/icons/128x128@2x.png +0 -0
- package/src-tauri/icons/32x32.png +0 -0
- package/src-tauri/icons/Square107x107Logo.png +0 -0
- package/src-tauri/icons/Square142x142Logo.png +0 -0
- package/src-tauri/icons/Square150x150Logo.png +0 -0
- package/src-tauri/icons/Square284x284Logo.png +0 -0
- package/src-tauri/icons/Square30x30Logo.png +0 -0
- package/src-tauri/icons/Square310x310Logo.png +0 -0
- package/src-tauri/icons/Square44x44Logo.png +0 -0
- package/src-tauri/icons/Square71x71Logo.png +0 -0
- package/src-tauri/icons/Square89x89Logo.png +0 -0
- package/src-tauri/icons/StoreLogo.png +0 -0
- package/src-tauri/icons/icon.icns +0 -0
- package/src-tauri/icons/icon.ico +0 -0
- package/src-tauri/icons/icon.png +0 -0
- package/src-tauri/src/lib.rs +93 -0
- package/src-tauri/src/main.rs +6 -0
- package/src-tauri/tauri.conf.json +49 -0
- package/tsconfig.json +25 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shaw Walters, aka Moon aka @lalalune
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Tauri + React + Typescript
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Tauri, React and Typescript in Vite.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
|
package/index.html
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" style="margin: 0; padding: 0;">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Eliza Desktop</title>
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
border: none;
|
|
13
|
+
}
|
|
14
|
+
html {
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
border: none;
|
|
18
|
+
}
|
|
19
|
+
#root {
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
border: none;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<div id="root"></div>
|
|
29
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/app",
|
|
3
|
+
"version": "1.0.0-alpha.33",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "tauri dev",
|
|
10
|
+
"dev": "vite",
|
|
11
|
+
"build": "tsc && vite build",
|
|
12
|
+
"preview": "vite preview",
|
|
13
|
+
"tauri": "tauri",
|
|
14
|
+
"tauri:dev": "tauri dev",
|
|
15
|
+
"tauri:build": "tauri build",
|
|
16
|
+
"typecheck": "tsc --noEmit"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@elizaos/cli": "1.0.0-alpha.33",
|
|
20
|
+
"@tauri-apps/api": "^2.3.0",
|
|
21
|
+
"@tauri-apps/plugin-opener": "^2",
|
|
22
|
+
"@tauri-apps/plugin-shell": "^2",
|
|
23
|
+
"react": "^19.0.0",
|
|
24
|
+
"react-dom": "^19.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@tauri-apps/cli": "^2",
|
|
28
|
+
"@types/react": "^19.0.0",
|
|
29
|
+
"@types/react-dom": "^19.0.0",
|
|
30
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
31
|
+
"typescript": "~5.8.2",
|
|
32
|
+
"vite": "^6.0.3"
|
|
33
|
+
},
|
|
34
|
+
"gitHead": "9f91567491d24af91e5a98dc05b12cf43cfedbc8"
|
|
35
|
+
}
|
package/public/tauri.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="206" height="231" viewBox="0 0 206 231" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M143.143 84C143.143 96.1503 133.293 106 121.143 106C108.992 106 99.1426 96.1503 99.1426 84C99.1426 71.8497 108.992 62 121.143 62C133.293 62 143.143 71.8497 143.143 84Z" fill="#FFC131"/>
|
|
3
|
+
<ellipse cx="84.1426" cy="147" rx="22" ry="22" transform="rotate(180 84.1426 147)" fill="#24C8DB"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M166.738 154.548C157.86 160.286 148.023 164.269 137.757 166.341C139.858 160.282 141 153.774 141 147C141 144.543 140.85 142.121 140.558 139.743C144.975 138.204 149.215 136.139 153.183 133.575C162.73 127.404 170.292 118.608 174.961 108.244C179.63 97.8797 181.207 86.3876 179.502 75.1487C177.798 63.9098 172.884 53.4021 165.352 44.8883C157.82 36.3744 147.99 30.2165 137.042 27.1546C126.095 24.0926 114.496 24.2568 103.64 27.6274C92.7839 30.998 83.1319 37.4317 75.8437 46.1553C74.9102 47.2727 74.0206 48.4216 73.176 49.5993C61.9292 50.8488 51.0363 54.0318 40.9629 58.9556C44.2417 48.4586 49.5653 38.6591 56.679 30.1442C67.0505 17.7298 80.7861 8.57426 96.2354 3.77762C111.685 -1.01901 128.19 -1.25267 143.769 3.10474C159.348 7.46215 173.337 16.2252 184.056 28.3411C194.775 40.457 201.767 55.4101 204.193 71.404C206.619 87.3978 204.374 103.752 197.73 118.501C191.086 133.25 180.324 145.767 166.738 154.548ZM41.9631 74.275L62.5557 76.8042C63.0459 72.813 63.9401 68.9018 65.2138 65.1274C57.0465 67.0016 49.2088 70.087 41.9631 74.275Z" fill="#FFC131"/>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.4045 76.4519C47.3493 70.6709 57.2677 66.6712 67.6171 64.6132C65.2774 70.9669 64 77.8343 64 85.0001C64 87.1434 64.1143 89.26 64.3371 91.3442C60.0093 92.8732 55.8533 94.9092 51.9599 97.4256C42.4128 103.596 34.8505 112.392 30.1816 122.756C25.5126 133.12 23.9357 144.612 25.6403 155.851C27.3449 167.09 32.2584 177.598 39.7906 186.112C47.3227 194.626 57.153 200.784 68.1003 203.846C79.0476 206.907 90.6462 206.743 101.502 203.373C112.359 200.002 122.011 193.568 129.299 184.845C130.237 183.722 131.131 182.567 131.979 181.383C143.235 180.114 154.132 176.91 164.205 171.962C160.929 182.49 155.596 192.319 148.464 200.856C138.092 213.27 124.357 222.426 108.907 227.222C93.458 232.019 76.9524 232.253 61.3736 227.895C45.7948 223.538 31.8055 214.775 21.0867 202.659C10.3679 190.543 3.37557 175.59 0.949823 159.596C-1.47592 143.602 0.768139 127.248 7.41237 112.499C14.0566 97.7497 24.8183 85.2327 38.4045 76.4519ZM163.062 156.711L163.062 156.711C162.954 156.773 162.846 156.835 162.738 156.897C162.846 156.835 162.954 156.773 163.062 156.711Z" fill="#24C8DB"/>
|
|
6
|
+
</svg>
|
package/public/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/src/main.tsx
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom/client";
|
|
3
|
+
// Using a simple try/catch for the Eliza server, avoiding Tauri API dependencies
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
|
|
6
|
+
// Component that will redirect the user to the Eliza client
|
|
7
|
+
function ElizaWrapper() {
|
|
8
|
+
const [status, setStatus] = useState<"starting" | "running" | "error">(
|
|
9
|
+
"starting"
|
|
10
|
+
);
|
|
11
|
+
const [error, setError] = useState<string | null>(null);
|
|
12
|
+
const [retryCount, setRetryCount] = useState(0);
|
|
13
|
+
const [isServerAccessible, setIsServerAccessible] = useState(false);
|
|
14
|
+
|
|
15
|
+
// Function to check if server is accessible
|
|
16
|
+
const checkServerAccessibility = async () => {
|
|
17
|
+
try {
|
|
18
|
+
await fetch("http://localhost:3000", {
|
|
19
|
+
method: "HEAD",
|
|
20
|
+
mode: "no-cors", // Just checking if we can connect, not actually getting a response
|
|
21
|
+
});
|
|
22
|
+
return true;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Start the Eliza server
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const startServer = async () => {
|
|
31
|
+
try {
|
|
32
|
+
console.log(
|
|
33
|
+
"Server should already be running or will be started through the backend"
|
|
34
|
+
);
|
|
35
|
+
setStatus("running");
|
|
36
|
+
|
|
37
|
+
// Start polling to check if the server is accessible
|
|
38
|
+
const checkInterval = setInterval(async () => {
|
|
39
|
+
console.log("Checking server accessibility...");
|
|
40
|
+
const isAccessible = await checkServerAccessibility();
|
|
41
|
+
if (isAccessible) {
|
|
42
|
+
console.log("Server is accessible!");
|
|
43
|
+
setIsServerAccessible(true);
|
|
44
|
+
clearInterval(checkInterval);
|
|
45
|
+
}
|
|
46
|
+
}, 1000);
|
|
47
|
+
|
|
48
|
+
// Clear interval after 60 seconds to prevent infinite polling
|
|
49
|
+
setTimeout(() => clearInterval(checkInterval), 60000);
|
|
50
|
+
} catch (err: unknown) {
|
|
51
|
+
console.error("Failed to start Eliza server:", err);
|
|
52
|
+
setStatus("error");
|
|
53
|
+
setError(
|
|
54
|
+
`Failed to start Eliza server: ${
|
|
55
|
+
err instanceof Error ? err.message : String(err)
|
|
56
|
+
}`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
startServer();
|
|
62
|
+
}, [retryCount]); // Dependency on retryCount allows us to retry
|
|
63
|
+
|
|
64
|
+
// Retry handler
|
|
65
|
+
const handleRetry = () => {
|
|
66
|
+
setStatus("starting");
|
|
67
|
+
setError(null);
|
|
68
|
+
setRetryCount((prev) => prev + 1);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// If the server is running and accessible, show the iframe
|
|
72
|
+
if (status === "running" && isServerAccessible) {
|
|
73
|
+
return (
|
|
74
|
+
<div style={{ width: "100%", height: "100vh", margin: 0, padding: 0 }}>
|
|
75
|
+
<iframe
|
|
76
|
+
src="http://localhost:3000"
|
|
77
|
+
title="Eliza Client"
|
|
78
|
+
style={{
|
|
79
|
+
width: "100%",
|
|
80
|
+
height: "100%",
|
|
81
|
+
border: "none",
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Show loading or error message
|
|
89
|
+
return (
|
|
90
|
+
<div
|
|
91
|
+
style={{
|
|
92
|
+
display: "flex",
|
|
93
|
+
flexDirection: "column",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
justifyContent: "center",
|
|
96
|
+
height: "100vh",
|
|
97
|
+
padding: "20px",
|
|
98
|
+
textAlign: "center",
|
|
99
|
+
fontFamily: "sans-serif",
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{status === "error" ? (
|
|
103
|
+
<>
|
|
104
|
+
<h2 style={{ color: "red" }}>Error</h2>
|
|
105
|
+
<p>{error}</p>
|
|
106
|
+
<button
|
|
107
|
+
type="button"
|
|
108
|
+
onClick={handleRetry}
|
|
109
|
+
style={{
|
|
110
|
+
marginTop: "20px",
|
|
111
|
+
padding: "10px 20px",
|
|
112
|
+
backgroundColor: "#0078d7",
|
|
113
|
+
color: "white",
|
|
114
|
+
border: "none",
|
|
115
|
+
borderRadius: "4px",
|
|
116
|
+
cursor: "pointer",
|
|
117
|
+
fontSize: "16px",
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
Retry
|
|
121
|
+
</button>
|
|
122
|
+
</>
|
|
123
|
+
) : (
|
|
124
|
+
<>
|
|
125
|
+
<h2>Starting Eliza Server...</h2>
|
|
126
|
+
<p>Please wait while we start the backend services.</p>
|
|
127
|
+
<div
|
|
128
|
+
style={{
|
|
129
|
+
marginTop: "20px",
|
|
130
|
+
display: "flex",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
justifyContent: "center",
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<div
|
|
136
|
+
style={{
|
|
137
|
+
width: "20px",
|
|
138
|
+
height: "20px",
|
|
139
|
+
borderRadius: "50%",
|
|
140
|
+
border: "2px solid #ccc",
|
|
141
|
+
borderTopColor: "#0078d7",
|
|
142
|
+
animation: "spin 1s linear infinite",
|
|
143
|
+
}}
|
|
144
|
+
/>
|
|
145
|
+
<style>
|
|
146
|
+
{`
|
|
147
|
+
@keyframes spin {
|
|
148
|
+
to { transform: rotate(360deg); }
|
|
149
|
+
}
|
|
150
|
+
`}
|
|
151
|
+
</style>
|
|
152
|
+
</div>
|
|
153
|
+
</>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
|
160
|
+
<React.StrictMode>
|
|
161
|
+
<ElizaWrapper />
|
|
162
|
+
</React.StrictMode>
|
|
163
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|