diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a603055..b086d6e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 diff --git a/actions/auth/auth.tsx b/actions/auth/auth.tsx index 24581c78..7fc8b7cb 100644 --- a/actions/auth/auth.tsx +++ b/actions/auth/auth.tsx @@ -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 @@ -20,6 +21,11 @@ output = { } print(json.dumps(output), end="") + +--- + +!metadata:getCreds:requirements.txt + `; export interface AuthProvider { diff --git a/electron/build.mjs b/electron/build.mjs index d533369c..b469756a 100644 --- a/electron/build.mjs +++ b/electron/build.mjs @@ -42,6 +42,11 @@ const options = { target: { target: 'nsis', }, + icon: 'electron/icon.ico' + }, + nsis: { + deleteAppDataOnUninstall: true, + differentialPackage: false }, linux: { maintainer: 'Acorn Labs', @@ -61,7 +66,6 @@ const options = { directories: { output: 'electron-dist' }, - nsis: {deleteAppDataOnUninstall: true}, publish: { provider: "github", publishAutoUpdate: false, diff --git a/electron/main.mjs b/electron/main.mjs index 267577c2..e5028518 100644 --- a/electron/main.mjs +++ b/electron/main.mjs @@ -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'; @@ -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, @@ -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()); diff --git a/package-lock.json b/package-lock.json index c850ad72..45e54979 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "assistant-studio", "version": "v0.9.4", "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", @@ -507,8 +507,9 @@ } }, "node_modules/@gptscript-ai/gptscript": { - "version": "v0.9.4", - "resolved": "git+ssh://git@github.com/gptscript-ai/node-gptscript.git#c413d6537ae2366ddfb23a8aef8a060c2d94d1a6", + "version": "0.9.5-rc1", + "resolved": "https://registry.npmjs.org/@gptscript-ai/gptscript/-/gptscript-0.9.5-rc1.tgz", + "integrity": "sha512-ECemK0wt9n5TEx+q7zRwNIhNso/Hy3fYXlie1pxENdk164jU6RVefUl6uEI/bVoI1xWEkqA/cjBGqKoRlIOPKw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 99c4ff7f..1b0c85b4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/server/app.mjs b/server/app.mjs index 6d5e8ade..ea3a558a 100644 --- a/server/app.mjs +++ b/server/app.mjs @@ -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 {