diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 326934314..36eebc970 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -75,6 +75,33 @@ jobs: cd packages/config-yaml npm ci + install-openai-adapters: + needs: install-root + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + + - name: Install openai-adapters dependencies + if: steps.openai-adapters-cache.outputs.cache-hit != 'true' + run: | + cd packages/openai-adapters + npm ci + config-yaml-checks: needs: install-config-yaml runs-on: ubuntu-latest @@ -133,7 +160,7 @@ jobs: npm ci core-checks: - needs: [install-core, install-config-yaml] + needs: [install-core, install-config-yaml, install-openai-adapters] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -160,11 +187,21 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build - name: Type check and lint run: | cd core @@ -174,7 +211,8 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} install-gui: - needs: [install-root, install-core, install-config-yaml] + needs: + [install-root, install-core, install-config-yaml, install-openai-adapters] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -205,11 +243,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Install gui dependencies if: steps.gui-cache.outputs.cache-hit != 'true' run: | @@ -221,7 +270,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" @@ -242,6 +290,12 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - uses: actions/cache@v4 id: config-yaml-cache with: @@ -253,6 +307,11 @@ jobs: cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Type check and lint run: | cd gui @@ -260,7 +319,8 @@ jobs: npm run lint binary-checks: - needs: [install-root, install-core, install-config-yaml] + needs: + [install-root, install-core, install-config-yaml, install-openai-adapters] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -291,11 +351,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Install binary dependencies if: steps.binary-cache.outputs.cache-hit != 'true' run: | @@ -308,7 +379,8 @@ jobs: npx tsc --noEmit install-vscode: - needs: [install-root, install-core, install-config-yaml] + needs: + [install-root, install-core, install-config-yaml, install-openai-adapters] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -339,11 +411,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Install vscode dependencies if: steps.vscode-cache.outputs.cache-hit != 'true' run: | @@ -384,11 +467,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Type check and lint run: | cd extensions/vscode @@ -402,7 +496,7 @@ jobs: npm run vitest core-tests: - needs: [install-core, install-config-yaml] + needs: [install-core, install-config-yaml, install-openai-adapters] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -422,11 +516,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Run core tests run: | cd core @@ -476,7 +581,7 @@ jobs: - uses: actions/checkout@v4 - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} @@ -515,7 +620,13 @@ jobs: vscode-package-extension: runs-on: ubuntu-latest - needs: [install-vscode, install-core, install-config-yaml] + needs: + [ + install-vscode, + install-core, + install-config-yaml, + install-openai-adapters, + ] steps: - uses: actions/checkout@v4 @@ -541,11 +652,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Package extension run: | cd extensions/vscode @@ -559,7 +681,13 @@ jobs: vscode-download-e2e-dependencies: runs-on: ubuntu-latest - needs: [install-vscode, install-core, install-config-yaml] + needs: + [ + install-vscode, + install-core, + install-config-yaml, + install-openai-adapters, + ] steps: - uses: actions/checkout@v4 @@ -612,6 +740,7 @@ jobs: install-vscode, install-core, install-config-yaml, + install-openai-adapters, ] runs-on: ubuntu-latest # Tests requiring secrets need approval from maintainers @@ -658,11 +787,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Fix VSCode binary permissions run: | chmod +x extensions/vscode/e2e/storage/VSCode-linux-x64/code @@ -726,7 +866,8 @@ jobs: path: extensions/vscode/e2e.log gui-tests: - needs: [install-gui, install-core, install-config-yaml] + needs: + [install-gui, install-core, install-config-yaml, install-openai-adapters] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -752,11 +893,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Install GUI dependencies if: steps.gui-cache.outputs.cache-hit != 'true' run: cd gui && npm ci @@ -769,7 +921,8 @@ jobs: npm test jetbrains-tests: - needs: [install-root, core-checks, install-config-yaml] + needs: + [install-root, core-checks, install-config-yaml, install-openai-adapters] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -784,11 +937,22 @@ jobs: path: packages/config-yaml/node_modules key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + - uses: actions/cache@v4 + id: openai-adapters-cache + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + - name: Build config-yaml run: | cd packages/config-yaml npm run build + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + - name: Setup Java uses: actions/setup-java@v4.5.0 with: @@ -903,6 +1067,7 @@ jobs: - jetbrains-tests - config-yaml-checks - install-config-yaml + - install-openai-adapters steps: - name: Decide whether the needed jobs succeeded or failed diff --git a/core/llm/index.ts b/core/llm/index.ts index 6cadb6992..78f5c4ff6 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -292,6 +292,7 @@ export abstract class BaseLLM implements ILLM { apiKey: this.apiKey ?? "", apiBase: this.apiBase, requestOptions: this.requestOptions, + env: this._llmOptions.env, }); } diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index 16d0e9542..106f99e1b 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -405,7 +405,6 @@ class Ollama extends BaseLLM implements ModelInstaller { parameters: tool.function.parameters, }, })); - chatOptions.stream = false; // Cannot set stream = true for tools calls } const headers: Record = { "Content-Type": "application/json", diff --git a/core/package-lock.json b/core/package-lock.json index 16e96ecfe..c5f56b712 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -14,9 +14,9 @@ "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", - "@continuedev/fetch": "^1.0.13", + "@continuedev/fetch": "^1.0.14", "@continuedev/llm-info": "^1.0.8", - "@continuedev/openai-adapters": "^1.0.32", + "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", @@ -141,7 +141,7 @@ }, "../packages/config-yaml": { "name": "@continuedev/config-yaml", - "version": "1.0.92", + "version": "1.0.94", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", @@ -161,6 +161,30 @@ "zod-to-json-schema": "^3.24.5" } }, + "../packages/openai-adapters": { + "name": "@continuedev/openai-adapters", + "version": "1.0.40", + "license": "Apache-2.0", + "dependencies": { + "@continuedev/config-types": "^1.0.5", + "@continuedev/config-yaml": "^1.0.51", + "@continuedev/fetch": "^1.0.11", + "dotenv": "^16.5.0", + "json-schema": "^0.4.0", + "node-fetch": "^3.3.2", + "openai": "^4.76.0", + "uuid": "^11.1.0", + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/follow-redirects": "^1.14.4", + "@types/jest": "^29.5.14", + "@types/json-schema": "^7.0.15", + "cross-env": "^7.0.3", + "ts-jest": "^29.2.3", + "ts-node": "^10.9.2" + } + }, "node_modules/@75lb/deep-merge": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", @@ -2885,9 +2909,10 @@ "link": true }, "node_modules/@continuedev/fetch": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.13.tgz", - "integrity": "sha512-7vwsefFBozsutv355zD7mEhFfl6UT4KXRH1QXRzjdbCaYneiRdFLe6UAwV2wGnH71Lj76gOLnTlcGoTV357OZg==", + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.14.tgz", + "integrity": "sha512-r/CUwW0tt7VrjLVNeowA281aq7VQvToE+Ro9+0EhfINBMNre4eU2MbNOgbRmYCr5VkIuSnltPUDI357Kns7uCw==", + "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.5", "follow-redirects": "^1.15.6", @@ -2902,32 +2927,8 @@ "integrity": "sha512-/htL7p4li3zQSwn9bXkI23WRpZNklWTPzRSSG3Fd5gvYW8cizjhlf7OzeDdKxBfi1S0lpqMm0VwHlx3KjMKLpw==" }, "node_modules/@continuedev/openai-adapters": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@continuedev/openai-adapters/-/openai-adapters-1.0.32.tgz", - "integrity": "sha512-teNzbpcsa7Y0eBk+dxlLDo0m43sWI5txTYMIk6ezyS0cZAKFJODDB0Gkp3aEHXbD8mDE7H5dDSlM23ohKCirAA==", - "dependencies": { - "@continuedev/config-types": "^1.0.5", - "@continuedev/config-yaml": "^1.0.51", - "@continuedev/fetch": "^1.0.11", - "dotenv": "^16.5.0", - "json-schema": "^0.4.0", - "node-fetch": "^3.3.2", - "openai": "^4.76.0", - "uuid": "^11.1.0", - "zod": "^3.24.2" - } - }, - "node_modules/@continuedev/openai-adapters/node_modules/uuid": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", - "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/esm/bin/uuid" - } + "resolved": "../packages/openai-adapters", + "link": true }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", diff --git a/core/package.json b/core/package.json index 679dc03cc..bb4eda7df 100644 --- a/core/package.json +++ b/core/package.json @@ -52,9 +52,9 @@ "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", - "@continuedev/fetch": "^1.0.13", + "@continuedev/fetch": "^1.0.14", "@continuedev/llm-info": "^1.0.8", - "@continuedev/openai-adapters": "^1.0.32", + "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", diff --git a/core/tools/definitions/createRuleBlock.ts b/core/tools/definitions/createRuleBlock.ts index 7d07cd4e1..9596122a3 100644 --- a/core/tools/definitions/createRuleBlock.ts +++ b/core/tools/definitions/createRuleBlock.ts @@ -16,7 +16,7 @@ export const createRuleBlock: Tool = { 'Creates a "rule" that can be referenced in future conversations. This should be used whenever you want to establish code standards / preferences that should be applied consistently, or when you want to avoid making a mistake again. To modify existing rules, use the edit tool instead.', parameters: { type: "object", - required: ["name", "rule", "alwaysApply", "description"], + required: ["name", "rule", "description"], properties: { name: { type: "string", diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 4e873f0db..7a3c3a8d9 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -211,6 +211,15 @@ const config = { enableInDevelopment: false, }, ], + [ + "docusaurus-plugin-llms-txt", + { + // Optional configuration + outputPath: "static/llms.txt", + includePatterns: ["docs/**"], + excludePatterns: ["**/node_modules/**"], + }, + ], [ "@docusaurus/plugin-client-redirects", { diff --git a/docs/package-lock.json b/docs/package-lock.json index f3a3ea446..684d04e98 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -14,6 +14,7 @@ "@docusaurus/preset-classic": "^3.7.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.1.0", + "docusaurus-plugin-llms-txt": "^0.1.3", "posthog-docusaurus": "^2.0.4", "prism-react-renderer": "^2.3.1", "react": "^18.2.0", @@ -7604,6 +7605,23 @@ "node": ">=6" } }, + "node_modules/docusaurus-plugin-llms-txt": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-llms-txt/-/docusaurus-plugin-llms-txt-0.1.3.tgz", + "integrity": "sha512-X/Dqf1/soHFjvELWXtfa9C023498HsWWwNPdVZEu0OoznI2Gzf+VCB/4obwpBSV9OeDeI8D94/dK/ETq534k9A==", + "license": "MIT", + "dependencies": { + "fs-extra": "^11.2.0", + "gray-matter": "^4.0.3" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "@docusaurus/core": ">=2.0.0", + "react": ">=16.8.0" + } + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", diff --git a/docs/package.json b/docs/package.json index 67b995070..af9538e94 100644 --- a/docs/package.json +++ b/docs/package.json @@ -22,6 +22,7 @@ "@docusaurus/preset-classic": "^3.7.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.1.0", + "docusaurus-plugin-llms-txt": "^0.1.3", "posthog-docusaurus": "^2.0.4", "prism-react-renderer": "^2.3.1", "react": "^18.2.0", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index ae23ee64a..117f8afcc 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -110,7 +110,7 @@ "@continuedev/config-yaml": "file:../packages/config-yaml", "@continuedev/fetch": "^1.0.13", "@continuedev/llm-info": "^1.0.8", - "@continuedev/openai-adapters": "^1.0.32", + "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", diff --git a/gui/package-lock.json b/gui/package-lock.json index 12339249b..736518314 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -115,7 +115,7 @@ "@continuedev/config-yaml": "file:../packages/config-yaml", "@continuedev/fetch": "^1.0.13", "@continuedev/llm-info": "^1.0.8", - "@continuedev/openai-adapters": "^1.0.32", + "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", diff --git a/gui/src/components/AssistantAndOrgListbox/AssistantOptions.tsx b/gui/src/components/AssistantAndOrgListbox/AssistantOptions.tsx index 869aa5c67..23c54184d 100644 --- a/gui/src/components/AssistantAndOrgListbox/AssistantOptions.tsx +++ b/gui/src/components/AssistantAndOrgListbox/AssistantOptions.tsx @@ -1,7 +1,4 @@ -import { ArrowPathIcon } from "@heroicons/react/24/outline"; -import { useState } from "react"; import { useAuth } from "../../context/Auth"; -import { cn } from "../../util/cn"; import { AssistantOption } from "./AssistantOption"; interface AssistantOptionsProps { @@ -13,30 +10,13 @@ export function AssistantOptions({ selectedProfileId, onClose, }: AssistantOptionsProps) { - const [loading, setLoading] = useState(false); - const { profiles, refreshProfiles } = useAuth(); + const { profiles } = useAuth(); return ( <> - {/* Assistants Section Header */}
-
{ - e.stopPropagation(); - setLoading(true); - await refreshProfiles(); - setLoading(false); - }} - > - -
+
diff --git a/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx b/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx index 131f0d1e1..bb0a301e1 100644 --- a/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx +++ b/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx @@ -1,6 +1,9 @@ import { ChevronDownIcon } from "@heroicons/react/24/outline"; +import { ArrowPathIcon } from "@heroicons/react/24/solid"; import type { ProfileDescription } from "core/config/ConfigHandler"; +import { useAppSelector } from "../../redux/hooks"; import { fontSize } from "../../util"; +import { cn } from "../../util/cn"; import { useLump } from "../mainInput/Lump/LumpContext"; import { ListboxButton } from "../ui"; import { AssistantIcon } from "./AssistantIcon"; @@ -13,6 +16,8 @@ export function SelectedAssistantButton({ selectedProfile, }: SelectedAssistantButtonProps) { const { isToolbarExpanded } = useLump(); + const configLoading = useAppSelector((store) => store.config.loading); + return (
-
- -
- - {selectedProfile.title} - + {configLoading ? ( + + + Loading + + ) : ( + <> +
+ +
+ + {selectedProfile.title} + + + )}
store.config.loading); const smallFont = useFontSize(-3); const tinyFont = useFontSize(-4); const shouldRenderOrgInfo = @@ -152,6 +160,30 @@ export function AssistantAndOrgListbox() { + login(false)} + > + { + e.stopPropagation(); + await refreshProfiles(); + }} + > + + Reload config + + +
{ + setLocalStorage("hasExitedFreeTrial", true); + + await ideMessenger.request("controlPlane/openUrl", { + path: "setup-models", + orgSlug: undefined, + }); + }; + return (
@@ -134,15 +144,7 @@ export default function FreeTrialButton({ )}
- { - await ideMessenger.request("controlPlane/openUrl", { - path: "setup-models", - orgSlug: undefined, - }); - }} - > + Exit trial