local-operator-ui 0.1.0-beta.4 → 0.1.0
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/README.md +17 -197
- package/bin/local-operator-ui.js +54 -0
- package/out/main/index.js +0 -0
- package/out/main/index.jsc +0 -0
- package/out/preload/index.jsc +0 -0
- package/package.json +18 -8
package/README.md
CHANGED
|
@@ -43,155 +43,33 @@ The Local Operator UI is a user interface for managing and interacting with the
|
|
|
43
43
|
|
|
44
44
|
Before you begin, ensure you have the following installed:
|
|
45
45
|
|
|
46
|
-
- **Node.js**: Version
|
|
47
|
-
- **
|
|
48
|
-
- **Local Operator Backend**: The UI connects to the Local Operator backend API. See the [Local Operator GitHub repository](https://github.com/damianvtran/local-operator) for installation instructions.
|
|
46
|
+
- **Node.js**: Version 22.13.1 or higher. It's recommended to use [nvm](https://github.com/nvm-sh/nvm) for managing Node.js versions.
|
|
47
|
+
- **Local Operator Backend**: The UI connects to the Local Operator backend API. See the [Local Operator GitHub repository](https://github.com/damianvtran/local-operator) for installation instructions. Install it globally or in a virtual environment with `pip install local-operator` and then boot it up on `localhost:1111` with `local-operator serve`.
|
|
49
48
|
|
|
50
|
-
### Installation
|
|
49
|
+
### NPM Installation
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
You can install and run Local Operator UI directly using [npx](https://docs.n8n.io/hosting/installation/npm/).
|
|
53
52
|
|
|
54
53
|
```bash
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
# Install and run in one command
|
|
55
|
+
npx local-operator-ui
|
|
57
56
|
```
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
This will download and execute the latest version of the Local Operator UI, launching the application immediately.
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
yarn install
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
**Configure environment variables:**
|
|
66
|
-
|
|
67
|
-
Copy the `.env.template` file to `.env` and update the values as needed:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
cp .env.template .env
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
The main environment variable is:
|
|
74
|
-
|
|
75
|
-
- `VITE_LOCAL_OPERATOR_API_URL`: URL of the Local Operator backend API (default: `http://localhost:1111`)
|
|
76
|
-
|
|
77
|
-
### Development
|
|
78
|
-
|
|
79
|
-
For local development, follow these steps:
|
|
80
|
-
|
|
81
|
-
**Start the development server:**
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
yarn dev
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
This command will start the Electron application in development mode, with hot reloading enabled for both the main process and the renderer process.
|
|
88
|
-
|
|
89
|
-
### Production
|
|
90
|
-
|
|
91
|
-
To build and run the application in production mode:
|
|
60
|
+
### Manual Installation
|
|
92
61
|
|
|
93
|
-
|
|
62
|
+
Alternatively, without npx, you can install the package globally with standard npm:
|
|
94
63
|
|
|
95
64
|
```bash
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
This command will run the pre-build script and then start the Electron application in production mode, loading the compiled assets.
|
|
100
|
-
|
|
101
|
-
## 🏗️ Project Structure
|
|
65
|
+
# Install globally
|
|
66
|
+
npm install -g local-operator-ui
|
|
102
67
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
local-operator-ui/
|
|
107
|
-
├── .github/ # GitHub configuration
|
|
108
|
-
│ └── workflows/ # GitHub Actions workflows
|
|
109
|
-
│ ├── ci.yml # CI workflow configuration
|
|
110
|
-
│ └── release.yml # Release workflow configuration
|
|
111
|
-
├── resources/ # Application resources (icons, images)
|
|
112
|
-
├── src/ # Source code
|
|
113
|
-
│ ├── main/ # Electron main process
|
|
114
|
-
│ │ └── index.ts # Main process entry point
|
|
115
|
-
│ ├── preload/ # Electron preload scripts
|
|
116
|
-
│ │ ├── index.d.ts # Type definitions
|
|
117
|
-
│ │ └── index.ts # Preload script
|
|
118
|
-
│ └── renderer/ # Renderer process (React application)
|
|
119
|
-
│ ├── index.html # HTML template
|
|
120
|
-
│ └── src/ # React application source
|
|
121
|
-
│ ├── api/ # API clients and utilities
|
|
122
|
-
│ │ ├── query-client.ts # React Query client setup
|
|
123
|
-
│ │ └── local-operator/ # Local Operator API client
|
|
124
|
-
│ │ ├── agents-api.ts # Agents API endpoints
|
|
125
|
-
│ │ ├── chat-api.ts # Chat API endpoints
|
|
126
|
-
│ │ ├── config-api.ts # Config API endpoints
|
|
127
|
-
│ │ ├── credentials-api.ts # Credentials API endpoints
|
|
128
|
-
│ │ ├── health-api.ts # Health API endpoints
|
|
129
|
-
│ │ ├── jobs-api.ts # Jobs API endpoints
|
|
130
|
-
│ │ ├── types.ts # API type definitions
|
|
131
|
-
│ │ └── index.ts # API client exports
|
|
132
|
-
│ ├── assets/ # Static assets
|
|
133
|
-
│ ├── components/ # React components
|
|
134
|
-
│ │ ├── agents/ # Agent management components
|
|
135
|
-
│ │ ├── chat/ # Chat interface components
|
|
136
|
-
│ │ ├── common/ # Shared/common components
|
|
137
|
-
│ │ ├── navigation/ # Navigation components
|
|
138
|
-
│ │ └── settings/ # Settings components
|
|
139
|
-
│ ├── hooks/ # Custom React hooks
|
|
140
|
-
│ ├── store/ # State management (Zustand)
|
|
141
|
-
│ ├── app.tsx # Main application component
|
|
142
|
-
│ ├── config.ts # Application configuration
|
|
143
|
-
│ ├── main.tsx # Application entry point
|
|
144
|
-
│ ├── theme.ts # MUI theme configuration
|
|
145
|
-
│ └── vite-env.d.ts # Vite environment type definitions
|
|
146
|
-
├── .env.template # Environment variables template
|
|
147
|
-
├── biome.json # Biome configuration
|
|
148
|
-
├── electron.vite.config.js # Electron Vite configuration
|
|
149
|
-
├── eslint.config.js # ESLint configuration
|
|
150
|
-
├── GITHUB_ACTIONS.md # GitHub Actions documentation
|
|
151
|
-
├── package.json # Project dependencies and scripts
|
|
152
|
-
├── tsconfig.json # TypeScript configuration
|
|
153
|
-
└── README.md # Project documentation
|
|
68
|
+
# Run the application
|
|
69
|
+
local-operator-ui
|
|
154
70
|
```
|
|
155
71
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
- **src/main**: Contains the Electron main process code
|
|
159
|
-
- **src/preload**: Contains the Electron preload scripts
|
|
160
|
-
- **src/renderer**: Contains the React application code
|
|
161
|
-
- **api**: API clients for communicating with the Local Operator backend
|
|
162
|
-
- **components**: React components organized by feature
|
|
163
|
-
- **hooks**: Custom React hooks for data fetching and state management
|
|
164
|
-
- **store**: Global state management using Zustand
|
|
165
|
-
|
|
166
|
-
## 🛠️ Technology Stack
|
|
167
|
-
|
|
168
|
-
The Local Operator UI is built with the following technologies:
|
|
169
|
-
|
|
170
|
-
### Core Technologies
|
|
171
|
-
|
|
172
|
-
- **Electron**: Cross-platform desktop application framework
|
|
173
|
-
- **React**: UI library for building component-based interfaces
|
|
174
|
-
- **TypeScript**: Typed superset of JavaScript for improved developer experience
|
|
175
|
-
- **Vite**: Modern frontend build tool
|
|
176
|
-
|
|
177
|
-
### UI Framework and Styling
|
|
178
|
-
|
|
179
|
-
- **Material UI (MUI)**: React component library implementing Google's Material Design
|
|
180
|
-
- **Styled Components**: CSS-in-JS library for component styling
|
|
181
|
-
- **Emotion**: CSS-in-JS library used by MUI
|
|
182
|
-
- **FontAwesome**: Icon library
|
|
183
|
-
|
|
184
|
-
### State Management and Data Fetching
|
|
185
|
-
|
|
186
|
-
- **Zustand**: Lightweight state management library
|
|
187
|
-
- **React Query**: Data fetching and caching library
|
|
188
|
-
- **Zod**: TypeScript-first schema validation
|
|
189
|
-
|
|
190
|
-
### Development Tools
|
|
191
|
-
|
|
192
|
-
- **Biome**: Fast linter and formatter for JavaScript and TypeScript
|
|
193
|
-
- **ESLint**: JavaScript and TypeScript linter
|
|
194
|
-
- **TypeScript**: Static type checking
|
|
72
|
+
After installation, the application will automatically connect to the Local Operator backend API at `http://localhost:1111` by default.
|
|
195
73
|
|
|
196
74
|
## ✨ Features
|
|
197
75
|
|
|
@@ -224,67 +102,9 @@ The Local Operator UI provides a comprehensive interface for interacting with AI
|
|
|
224
102
|
- Real-time status updates for long-running operations
|
|
225
103
|
- Error handling and retry mechanisms
|
|
226
104
|
|
|
227
|
-
## 🧪 Testing
|
|
228
|
-
|
|
229
|
-
The project uses Jest for testing. To run tests:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
yarn test
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## 🔄 Continuous Integration and Deployment
|
|
236
|
-
|
|
237
|
-
This project uses GitHub Actions for continuous integration and automated publishing to npm. The workflows include:
|
|
238
|
-
|
|
239
|
-
- **CI**: Runs Biome linting and security audits on pushes to `main` and `dev-*` branches
|
|
240
|
-
- **Release**: Automatically publishes the package to npm when a new GitHub Release is created
|
|
241
|
-
|
|
242
|
-
For detailed information on setting up and using these workflows, see [GITHUB_ACTIONS.md](./GITHUB_ACTIONS.md).
|
|
243
|
-
|
|
244
|
-
## 🔧 Linting and Formatting
|
|
245
|
-
|
|
246
|
-
The project uses Biome for linting and formatting. To lint and format the code:
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
# Check for linting issues
|
|
250
|
-
yarn lint
|
|
251
|
-
|
|
252
|
-
# Fix linting issues
|
|
253
|
-
yarn lint:fix
|
|
254
|
-
|
|
255
|
-
# Format code
|
|
256
|
-
yarn format
|
|
257
|
-
|
|
258
|
-
# Fix formatting issues
|
|
259
|
-
yarn format:fix
|
|
260
|
-
```
|
|
261
|
-
|
|
262
105
|
## 🤝 Contributing
|
|
263
106
|
|
|
264
|
-
Contributions are welcome!
|
|
265
|
-
|
|
266
|
-
1. Fork the repository
|
|
267
|
-
2. Create a new branch (`git checkout -b feature/your-feature-name`)
|
|
268
|
-
3. Make your changes
|
|
269
|
-
4. Run tests and linting (`yarn test && yarn lint`)
|
|
270
|
-
5. Commit your changes (`git commit -m 'Add some feature'`)
|
|
271
|
-
6. Push to the branch (`git push origin feature/your-feature-name`)
|
|
272
|
-
7. Open a Pull Request
|
|
273
|
-
|
|
274
|
-
Please ensure your code follows the project's coding standards:
|
|
275
|
-
|
|
276
|
-
- Use TypeScript for all new code
|
|
277
|
-
- Follow the existing code style and patterns
|
|
278
|
-
- Write tests for new features
|
|
279
|
-
- Update documentation as needed
|
|
280
|
-
|
|
281
|
-
### Code Style Guidelines
|
|
282
|
-
|
|
283
|
-
- Use `type` instead of `interface` for type definitions
|
|
284
|
-
- Use kebab-case for file names and PascalCase for component names
|
|
285
|
-
- Use named exports instead of default exports
|
|
286
|
-
- Include JSDoc documentation where appropriate
|
|
287
|
-
- Follow Biome linting conventions
|
|
107
|
+
Contributions are welcome! Please see our [Contributing Guide](./CONTRIBUTING.md) for details on how to get started with development, code style guidelines, and our contribution process.
|
|
288
108
|
|
|
289
109
|
## 🐛 Troubleshooting
|
|
290
110
|
|
|
@@ -292,8 +112,8 @@ Please ensure your code follows the project's coding standards:
|
|
|
292
112
|
|
|
293
113
|
#### Application fails to connect to the backend
|
|
294
114
|
|
|
295
|
-
- Ensure the Local Operator backend is running
|
|
296
|
-
- Check that the `VITE_LOCAL_OPERATOR_API_URL` environment variable is set
|
|
115
|
+
- Ensure the Local Operator backend is running and hosting on `http://localhost:1111`
|
|
116
|
+
- Check that the `VITE_LOCAL_OPERATOR_API_URL` environment variable has not been set to a different URL. This value is set automatically to `http://localhost:1111` if a custom `.env` doesn't specify otherwise.
|
|
297
117
|
- Verify network connectivity between the UI and the backend
|
|
298
118
|
|
|
299
119
|
#### Development server crashes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Local Operator UI CLI
|
|
5
|
+
*
|
|
6
|
+
* This script serves as the entry point for the npx command.
|
|
7
|
+
* It launches the Electron app.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { spawn } = require("node:child_process");
|
|
11
|
+
const path = require("node:path");
|
|
12
|
+
const fs = require("node:fs");
|
|
13
|
+
|
|
14
|
+
// Get the path to the electron executable
|
|
15
|
+
const electronPath = require("electron");
|
|
16
|
+
|
|
17
|
+
// Get the path to the main.js file
|
|
18
|
+
const appPath = path.join(__dirname, "../out/main/index.js");
|
|
19
|
+
|
|
20
|
+
// Check if the main.js file exists
|
|
21
|
+
if (!fs.existsSync(appPath)) {
|
|
22
|
+
console.error("Error: Could not find the application entry point.");
|
|
23
|
+
console.error(
|
|
24
|
+
"This could happen if the application was not built correctly.",
|
|
25
|
+
);
|
|
26
|
+
console.error("Please report this issue to the package maintainer.");
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Launch the Electron app
|
|
31
|
+
const child = spawn(electronPath, [appPath], {
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
windowsHide: false,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Handle process exit
|
|
37
|
+
child.on("close", (code) => {
|
|
38
|
+
process.exit(code);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Handle errors
|
|
42
|
+
child.on("error", (err) => {
|
|
43
|
+
console.error("Failed to start Electron application:", err);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Handle process termination
|
|
48
|
+
process.on("SIGINT", () => {
|
|
49
|
+
child.kill("SIGINT");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
process.on("SIGTERM", () => {
|
|
53
|
+
child.kill("SIGTERM");
|
|
54
|
+
});
|
package/out/main/index.js
CHANGED
|
File without changes
|
package/out/main/index.jsc
CHANGED
|
Binary file
|
package/out/preload/index.jsc
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "local-operator-ui",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "User interface for the Local Operator agent environment",
|
|
5
5
|
"main": "./out/main/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"local-operator-ui": "./bin/local-operator-ui.js"
|
|
8
|
+
},
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"author": {
|
|
8
11
|
"name": "Damian Tran",
|
|
@@ -24,23 +27,30 @@
|
|
|
24
27
|
"bugs": {
|
|
25
28
|
"url": "https://github.com/damianvtran/local-operator-ui/issues"
|
|
26
29
|
},
|
|
27
|
-
"keywords": [
|
|
28
|
-
|
|
30
|
+
"keywords": [
|
|
31
|
+
"local-operator",
|
|
32
|
+
"agent",
|
|
33
|
+
"python",
|
|
34
|
+
"tool use",
|
|
35
|
+
"ui",
|
|
36
|
+
"electron",
|
|
37
|
+
"react"
|
|
38
|
+
],
|
|
39
|
+
"files": ["out", "bin", "LICENSE", "README.md"],
|
|
29
40
|
"publishConfig": {
|
|
30
41
|
"access": "public"
|
|
31
42
|
},
|
|
32
|
-
"bin": {
|
|
33
|
-
"local-operator-ui": "./out/main/index.js"
|
|
34
|
-
},
|
|
35
43
|
"scripts": {
|
|
36
44
|
"start": "electron-vite preview",
|
|
37
45
|
"dev": "electron-vite dev",
|
|
38
|
-
"build": "electron-vite build
|
|
46
|
+
"build": "electron-vite build",
|
|
47
|
+
"postbuild": "chmod +x ./bin/local-operator-ui.js",
|
|
39
48
|
"lint": "npx @biomejs/biome check src",
|
|
40
49
|
"lint:fix": "npx @biomejs/biome check --apply src",
|
|
41
50
|
"format": "npx @biomejs/biome format src",
|
|
42
51
|
"format:fix": "npx @biomejs/biome format --write src",
|
|
43
|
-
"prepublishOnly": "npm run build"
|
|
52
|
+
"prepublishOnly": "npm run build",
|
|
53
|
+
"check-types": "tsc --noEmit"
|
|
44
54
|
},
|
|
45
55
|
"dependencies": {
|
|
46
56
|
"@electron-toolkit/utils": "^4.0.0",
|