forked from block/goose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
App working, cursor messing up big time.
- Loading branch information
1 parent
0f7f4c9
commit 4f0aadd
Showing
5 changed files
with
145 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
description: Basic codebase instructions | ||
globs: | ||
--- | ||
# Codebase Rules | ||
|
||
1. ALWAYS check existing files before creating new ones: | ||
|
||
- Search in the codebase for similar functionality | ||
- Check recently viewed files | ||
- Use grep/semantic search to find related code | ||
|
||
2. Framework & Architecture: | ||
|
||
- This is an Electron app, NOT Tauri | ||
- Use ESM modules with .mts extension | ||
- Follow functional programming patterns | ||
- Use the existing package manager (check package.json) | ||
|
||
3. File Organization: | ||
|
||
- Check ui-svelte/src-main/ for main process code | ||
- Check ui-svelte/src-renderer/ for renderer process code | ||
- Respect the existing file structure | ||
- Don't duplicate functionality | ||
|
||
4. Before Making Changes: | ||
- Read the TypeScript organization guide | ||
- Check for existing implementations | ||
- Verify the tech stack being used | ||
- Follow existing patterns in the codebase | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
description: Read the Typescript instructions file | ||
globs: | ||
--- | ||
|
||
[types_instructions.md](mdc:acumen/types_instructions.md) | ||
|
||
Read and update the typescript instructions file: 'acumen/types_instructions.md'. | ||
|
||
# TypeScript Rules | ||
|
||
1. Types MUST be in `.d.ts` files following the structure: | ||
|
||
``` | ||
ui-svelte/ | ||
├── src-main/types/ | ||
│ ├── electron.d.ts # IPC & Window API | ||
│ ├── ipc.d.ts # IPC Events & Payloads | ||
│ └── config.d.ts # App & Env Config | ||
├── src-renderer/ | ||
├── app.d.ts # Global & Window | ||
└── types/ # Shared Types | ||
``` | ||
|
||
2. NO type duplication across processes | ||
3. Use `import type` statements | ||
4. Component types stay with components | ||
5. Prefer interfaces over type aliases | ||
6. Use strict TypeScript config | ||
7. Use barrel exports in index.d.ts files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Environment variable constants | ||
export const GOOSE_PROVIDER = "GOOSE_PROVIDER"; | ||
export const GOOSE_MODEL = "GOOSE_MODEL"; | ||
|
||
// Provider API Keys | ||
export const OPENAI_API_KEY = "OPENAI_API_KEY"; | ||
export const ANTHROPIC_API_KEY = "ANTHROPIC_API_KEY"; | ||
export const AZURE_API_KEY = "AZURE_API_KEY"; | ||
export const GOOGLE_API_KEY = "GOOGLE_API_KEY"; | ||
export const MISTRAL_API_KEY = "MISTRAL_API_KEY"; | ||
|
||
// Load environment variables from shell if in production | ||
export async function loadShellEnv( | ||
isProduction: boolean = false | ||
): Promise<void> { | ||
// Only proceed if running on macOS and in production mode | ||
if (process.platform !== "darwin" || !isProduction) { | ||
console.info( | ||
`Skipping shell environment loading: ${ | ||
process.platform !== "darwin" | ||
? "Not running on macOS" | ||
: "Not in production mode" | ||
}` | ||
); | ||
return; | ||
} | ||
|
||
try { | ||
console.info("Loading environment variables from shell"); | ||
const { execSync } = await import("child_process"); | ||
|
||
const shell = process.env.SHELL || "/bin/bash"; | ||
const envStr = execSync(`${shell} -l -i -c 'env'`, { | ||
encoding: "utf-8", | ||
}); | ||
|
||
// Parse and set environment variables | ||
envStr.split("\n").forEach((line) => { | ||
const matches = line.match(/^([^=]+)=(.*)$/); | ||
if (matches) { | ||
const [, key, value] = matches; | ||
console.info(`Setting ${key}`); | ||
process.env[key] = value; | ||
} | ||
}); | ||
|
||
console.info("Successfully loaded shell environment variables"); | ||
} catch (error) { | ||
console.error("Failed to load shell environment variables:", error); | ||
} | ||
} | ||
|
||
// Get all provider API keys | ||
export function getProviderKeys(): Record<string, string | undefined> { | ||
return { | ||
[OPENAI_API_KEY]: process.env[OPENAI_API_KEY], | ||
[ANTHROPIC_API_KEY]: process.env[ANTHROPIC_API_KEY], | ||
[AZURE_API_KEY]: process.env[AZURE_API_KEY], | ||
[GOOGLE_API_KEY]: process.env[GOOGLE_API_KEY], | ||
[MISTRAL_API_KEY]: process.env[MISTRAL_API_KEY], | ||
}; | ||
} | ||
|
||
// Update environment variables | ||
export function updateEnvironmentVariables( | ||
envToggles: Record<string, boolean> | ||
): void { | ||
Object.entries(envToggles).forEach(([key, enabled]) => { | ||
if (!enabled && process.env[key]) { | ||
delete process.env[key]; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters