Skip to content

Commit

Permalink
copy current ui back
Browse files Browse the repository at this point in the history
  • Loading branch information
lily-de committed Feb 22, 2025
1 parent f07f753 commit 609ef4a
Show file tree
Hide file tree
Showing 115 changed files with 5,194 additions and 4,045 deletions.
3 changes: 2 additions & 1 deletion ui/desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.vite/
out
src/bin/goosed
src/bin/goosed
/src/bin/goosed.exe
1 change: 1 addition & 0 deletions ui/desktop/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
out
src/api/generated
*.lock
3 changes: 2 additions & 1 deletion ui/desktop/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const noWindowLocationHref = {
) {
context.report({
node,
message: 'Do not use window.location.href directly in Electron apps. Use React Router\'s navigate() instead.'
message: 'Do not use window.location.href directly in Electron apps. Use setView from the project instead'
});
}
}
Expand All @@ -37,6 +37,7 @@ const noWindowLocationHref = {
module.exports = [
js.configs.recommended,
{
ignores: ['src/api/generated/**'],
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
Expand Down
27 changes: 22 additions & 5 deletions ui/desktop/forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ let cfg = {
asar: true,
extraResource: ['src/bin', 'src/images'],
icon: 'src/images/icon',
// Windows specific configuration
win32: {
icon: 'src/images/icon.ico',
certificateFile: process.env.WINDOWS_CERTIFICATE_FILE,
certificatePassword: process.env.WINDOWS_CERTIFICATE_PASSWORD,
rfc3161TimeStampServer: 'http://timestamp.digicert.com',
signWithParams: '/fd sha256 /tr http://timestamp.digicert.com /td sha256'
},
// Protocol registration
protocols: [
{
name: "GooseProtocol",
schemes: ["goose"]
}
],
// macOS specific configuration
osxSign: {
entitlements: 'entitlements.plist',
'entitlements-inherit': 'entitlements.plist',
Expand Down Expand Up @@ -34,13 +50,14 @@ module.exports = {
packagerConfig: cfg,
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
platforms: ['darwin', 'win32'],
config: {
options: {
icon: 'src/images/icon.ico'
}
}
},
{
name: '@electron-forge/maker-deb',
Expand Down
5 changes: 0 additions & 5 deletions ui/desktop/helper-scripts/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions ui/desktop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<title>Goose</title>
<link href="/src/styles/main.css" rel="stylesheet" />
<link href="./src/styles/main.css" rel="stylesheet" />
</head>
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
Expand All @@ -19,6 +19,6 @@
</script>
<body>
<div id="root"></div>
<script type="module" src="/src/renderer.tsx"></script>
<script type="module" src="./src/renderer.tsx"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions ui/desktop/openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
input: './openapi.json',
output: './src/api/generated',
plugins: ['@hey-api/client-fetch'],
});
264 changes: 264 additions & 0 deletions ui/desktop/openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
{
"openapi": "3.0.3",
"info": {
"title": "goose-server",
"description": "An AI agent",
"contact": {
"name": "Block",
"email": "[email protected]"
},
"license": {
"name": "Apache-2.0"
},
"version": "1.0.8"
},
"paths": {
"/config": {
"get": {
"tags": [
"super::routes::config_management"
],
"operationId": "read_all_config",
"responses": {
"200": {
"description": "All configuration values retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConfigResponse"
}
}
}
}
}
}
},
"/config/extension": {
"post": {
"tags": [
"super::routes::config_management"
],
"operationId": "add_extension",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExtensionQuery"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Extension added successfully",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request"
},
"500": {
"description": "Internal server error"
}
}
},
"delete": {
"tags": [
"super::routes::config_management"
],
"operationId": "remove_extension",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConfigKeyQuery"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Extension removed successfully",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"404": {
"description": "Extension not found"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/config/read": {
"get": {
"tags": [
"super::routes::config_management"
],
"operationId": "read_config",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConfigKeyQuery"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Configuration value retrieved successfully",
"content": {
"application/json": {
"schema": {}
}
}
},
"404": {
"description": "Configuration key not found"
}
}
}
},
"/config/remove": {
"post": {
"tags": [
"super::routes::config_management"
],
"operationId": "remove_config",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConfigKeyQuery"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Configuration value removed successfully",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"404": {
"description": "Configuration key not found"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/config/upsert": {
"post": {
"tags": [
"super::routes::config_management"
],
"operationId": "upsert_config",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpsertConfigQuery"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Configuration value upserted successfully",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
},
"500": {
"description": "Internal server error"
}
}
}
}
},
"components": {
"schemas": {
"ConfigKeyQuery": {
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"type": "string"
}
}
},
"ConfigResponse": {
"type": "object",
"required": [
"config"
],
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
}
}
},
"ExtensionQuery": {
"type": "object",
"required": [
"name",
"config"
],
"properties": {
"config": {},
"name": {
"type": "string"
}
}
},
"UpsertConfigQuery": {
"type": "object",
"required": [
"key",
"value"
],
"properties": {
"is_secret": {
"type": "boolean",
"nullable": true
},
"key": {
"type": "string"
},
"value": {}
}
}
}
}
}
Loading

0 comments on commit 609ef4a

Please sign in to comment.