Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-13]
os: [
macos-latest,
macos-13,
windows-latest
]

steps:
- name: Checkout repository
Expand All @@ -28,6 +32,7 @@ jobs:
run: npm install

- name: Decode and save APPLE_API_KEY
if: runner.os == 'macOS'
run: echo "${{ secrets.ELECTRON_APPLE_API_KEY }}" | base64 --decode > /tmp/apikey.p8

- name: Build Electron app
Expand Down
6 changes: 6 additions & 0 deletions actions/auth/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Block, RunEventType, ToolDef } from "@gptscript-ai/gptscript"

const tokenRequestToolInstructions = `
Credential: github.com/gptscript-ai/gateway-creds as github.com/gptscript-ai/gateway
Name: getCreds

#!/usr/bin/env python3

Expand All @@ -20,6 +21,11 @@ output = {
}

print(json.dumps(output), end="")

---

!metadata:getCreds:requirements.txt

`;

export interface AuthProvider {
Expand Down
6 changes: 5 additions & 1 deletion electron/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ const options = {
target: {
target: 'nsis',
},
icon: 'electron/icon.ico'
},
nsis: {
deleteAppDataOnUninstall: true,
differentialPackage: false
},
linux: {
maintainer: 'Acorn Labs',
Expand All @@ -61,7 +66,6 @@ const options = {
directories: {
output: 'electron-dist'
},
nsis: {deleteAppDataOnUninstall: true},
publish: {
provider: "github",
publishAutoUpdate: false,
Expand Down
9 changes: 7 additions & 2 deletions electron/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { startAppServer } from '../server/app.mjs';
import { join, dirname } from "path";
import { existsSync, mkdirSync } from "fs";
import fixPath from "fix-path";
import os from 'os';

const appName = 'Assistant Studio';
const gatewayUrl = process.env.GATEWAY_URL || 'https://gateway-api.gptscript.ai';
Expand Down Expand Up @@ -48,10 +49,11 @@ async function startServer(isPackaged) {
}

function createWindow(url) {
const isMac = os.platform() === 'darwin';
const win = new BrowserWindow({
width: 1024,
height: 720,
frame: false, // This removes the title bar
frame: isMac ? false : true, // Use frame: true for Windows and Linux
webPreferences: {
preload: join(app.getAppPath(), "electron/preload.js"),
nodeIntegration: true,
Expand All @@ -61,7 +63,10 @@ function createWindow(url) {
}
});

win.setWindowButtonVisibility(true)
// Check if the platform is macOS before calling setWindowButtonVisibility
if (isMac) {
win.setWindowButtonVisibility(true);
}

win.loadURL(url);
win.webContents.on("did-fail-load", () => win.webContents.reloadIgnoringCache());
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"main": "electron/main.mjs",
"dependencies": {
"@gptscript-ai/gptscript": "github:gptscript-ai/node-gptscript#c413d65",
"@gptscript-ai/gptscript": "^0.9.5-rc1",
"@monaco-editor/react": "^4.6.0",
"@nextui-org/button": "2.0.32",
"@nextui-org/code": "2.0.28",
Expand Down
2 changes: 1 addition & 1 deletion server/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function gptscriptConfigPath() {
if (os.platform() === 'darwin') {
configDir = process.env.XDG_CONFIG_HOME || path.join(homeDir, 'Library', 'Application Support')
} else if (os.platform() === 'win32') {
configDir = process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming');
configDir = path.join(homeDir, 'AppData', 'Local');
} else if (os.platform() === 'linux') {
configDir = process.env.XDG_CONFIG_HOME || path.join(homeDir, '.config');
} else {
Expand Down