mirror of
https://github.com/AIPexStudio/AIPex.git
synced 2026-05-13 18:51:35 +00:00
build(deps): bump ai from 5.0.105 to 6.0.27 (#91)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 0x5457 <0x5457@protonmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
"lint:fix": "biome check . --fix --unsafe",
|
||||
"lint:dependencies": "knip --strict",
|
||||
"test": "pnpm -r --if-present test",
|
||||
"typecheck": "tsc --build",
|
||||
"typecheck": "pnpm -r --if-present typecheck",
|
||||
"bump": "bumpp"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -126,10 +126,6 @@
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@ai-sdk/anthropic": "^2.0.51",
|
||||
"@ai-sdk/google": "^2.0.44",
|
||||
"@ai-sdk/openai": "^2.0.75",
|
||||
"@ai-sdk/openai-compatible": "^1.0.28",
|
||||
"@aipexstudio/aipex-core": "workspace:*",
|
||||
"@radix-ui/react-avatar": "^1.1.11",
|
||||
"@radix-ui/react-collapsible": "^1.1.12",
|
||||
@@ -144,7 +140,7 @@
|
||||
"@radix-ui/react-tabs": "^1.1.13",
|
||||
"@radix-ui/react-tooltip": "^1.2.8",
|
||||
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
||||
"ai": "^5.0.105",
|
||||
"ai": "^6.0.28",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
|
||||
@@ -39,16 +39,22 @@ const getStatusBadge = (status: ToolUIPart["state"] | "executing") => {
|
||||
"input-streaming": "Pending",
|
||||
"input-available": "Running",
|
||||
executing: "Running",
|
||||
"approval-requested": "Approval Requested",
|
||||
"approval-responded": "Approved",
|
||||
"output-available": "Completed",
|
||||
"output-error": "Error",
|
||||
"output-denied": "Denied",
|
||||
} as const;
|
||||
|
||||
const icons = {
|
||||
"input-streaming": <CircleIcon className="size-4" />,
|
||||
"input-available": <ClockIcon className="size-4 animate-pulse" />,
|
||||
executing: <ClockIcon className="size-4 animate-spin" />,
|
||||
"approval-requested": <ClockIcon className="size-4 text-yellow-600" />,
|
||||
"approval-responded": <CheckCircleIcon className="size-4 text-blue-600" />,
|
||||
"output-available": <CheckCircleIcon className="size-4 text-green-600" />,
|
||||
"output-error": <XCircleIcon className="size-4 text-red-600" />,
|
||||
"output-denied": <XCircleIcon className="size-4 text-orange-600" />,
|
||||
} as const;
|
||||
|
||||
return (
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Tests for FakeMouse component
|
||||
*/
|
||||
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
import { act, render, waitFor } from "@testing-library/react";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { FakeMouse } from "./fake-mouse";
|
||||
import type { FakeMouseController } from "./types";
|
||||
@@ -41,7 +41,9 @@ describe("FakeMouse", () => {
|
||||
expect(controller).not.toBeNull();
|
||||
});
|
||||
|
||||
controller!.show();
|
||||
await act(async () => {
|
||||
controller!.show();
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
const svg = document.querySelector("svg");
|
||||
@@ -64,8 +66,10 @@ describe("FakeMouse", () => {
|
||||
expect(controller).not.toBeNull();
|
||||
});
|
||||
|
||||
controller!.show();
|
||||
controller!.showTooltip("Test tooltip");
|
||||
await act(async () => {
|
||||
controller!.show();
|
||||
controller!.showTooltip("Test tooltip");
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
const tooltipText = document.body.textContent;
|
||||
@@ -94,7 +98,9 @@ describe("FakeMouse", () => {
|
||||
expect(controller).not.toBeNull();
|
||||
});
|
||||
|
||||
controller!.show();
|
||||
await act(async () => {
|
||||
controller!.show();
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
const cursor = document.querySelector('[style*="width"]');
|
||||
@@ -117,14 +123,18 @@ describe("FakeMouse", () => {
|
||||
expect(controller).not.toBeNull();
|
||||
});
|
||||
|
||||
controller!.show();
|
||||
await act(async () => {
|
||||
controller!.show();
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
const svg = document.querySelector("svg");
|
||||
expect(svg).not.toBeNull();
|
||||
});
|
||||
|
||||
unmount();
|
||||
await act(async () => {
|
||||
unmount();
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
const svg = document.querySelector("svg");
|
||||
|
||||
@@ -30,7 +30,6 @@ import {
|
||||
} from "lucide-react";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "../../i18n/context";
|
||||
import { createAIProvider } from "../../lib/ai-provider";
|
||||
import { cn } from "../../lib/utils";
|
||||
import { useTheme } from "../../theme/context";
|
||||
import { DEFAULT_MODELS } from "../chatbot/constants";
|
||||
@@ -598,49 +597,35 @@ export function SettingsPage({
|
||||
}
|
||||
|
||||
try {
|
||||
if (onTestConnection) {
|
||||
const success = await onTestConnection({
|
||||
...settings,
|
||||
aiHost,
|
||||
aiToken,
|
||||
aiModel,
|
||||
aiProvider: providerKey,
|
||||
providerType,
|
||||
customModels,
|
||||
if (!onTestConnection) {
|
||||
setSaveStatus({
|
||||
type: "error",
|
||||
message: "Test connection handler not provided",
|
||||
});
|
||||
if (success) {
|
||||
setSaveStatus({
|
||||
type: "success",
|
||||
message: t("settings.testSuccess"),
|
||||
});
|
||||
} else {
|
||||
setSaveStatus({
|
||||
type: "error",
|
||||
message: t("settings.testFailed"),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Default test implementation - use AI SDK directly (same as runtime)
|
||||
const { generateText } = await import("ai");
|
||||
setIsTesting(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create provider using the same logic as runtime
|
||||
const provider = createAIProvider({
|
||||
aiProvider: providerKey,
|
||||
aiHost,
|
||||
aiToken,
|
||||
aiModel,
|
||||
});
|
||||
|
||||
// Use AI SDK to make the request (handles all URL construction automatically)
|
||||
await generateText({
|
||||
model: provider(aiModel),
|
||||
prompt: "Hi",
|
||||
});
|
||||
const success = await onTestConnection({
|
||||
...settings,
|
||||
aiHost,
|
||||
aiToken,
|
||||
aiModel,
|
||||
aiProvider: providerKey,
|
||||
providerType,
|
||||
customModels,
|
||||
});
|
||||
|
||||
if (success) {
|
||||
setSaveStatus({
|
||||
type: "success",
|
||||
message: t("settings.testSuccess"),
|
||||
});
|
||||
} else {
|
||||
setSaveStatus({
|
||||
type: "error",
|
||||
message: t("settings.testFailed"),
|
||||
});
|
||||
}
|
||||
setTimeout(() => setSaveStatus({ type: "", message: "" }), 5000);
|
||||
} catch (error) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Utility functions and helpers
|
||||
*/
|
||||
|
||||
export { createAIProvider, type ProviderConfig } from "./ai-provider.js";
|
||||
export {
|
||||
globalPluginRegistry,
|
||||
PluginRegistry,
|
||||
|
||||
@@ -28,9 +28,10 @@
|
||||
"host-access-config.json"
|
||||
],
|
||||
"dependencies": {
|
||||
"@ai-sdk/anthropic": "^2.0.51",
|
||||
"@ai-sdk/google": "^2.0.44",
|
||||
"@ai-sdk/openai": "^2.0.75",
|
||||
"@ai-sdk/anthropic": "^3.0.10",
|
||||
"@ai-sdk/google": "^3.0.6",
|
||||
"@ai-sdk/openai": "^3.0.8",
|
||||
"@ai-sdk/openai-compatible": "^2.0.5",
|
||||
"@aipexstudio/aipex-core": "workspace:*",
|
||||
"@aipexstudio/aipex-react": "workspace:*",
|
||||
"@aipexstudio/browser-runtime": "workspace:*",
|
||||
@@ -47,7 +48,7 @@
|
||||
"@radix-ui/react-tooltip": "^1.2.8",
|
||||
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
||||
"ahooks": "^3.9.6",
|
||||
"ai": "^5.0.105",
|
||||
"ai": "^6.0.28",
|
||||
"assistant-ui": "^0.0.67",
|
||||
"bip39": "^3.1.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import type { AppSettings } from "@aipexstudio/aipex-core";
|
||||
import { aisdk, SessionStorage } from "@aipexstudio/aipex-core";
|
||||
import { createAIProvider } from "@aipexstudio/aipex-react";
|
||||
import { SYSTEM_PROMPT } from "@aipexstudio/aipex-react/components/chatbot/constants";
|
||||
import {
|
||||
allBrowserProviders,
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
IndexedDBStorage,
|
||||
} from "@aipexstudio/browser-runtime";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { createAIProvider } from "./ai-provider";
|
||||
|
||||
/**
|
||||
* Create browser-specific storage instance
|
||||
@@ -36,7 +36,12 @@ export function useBrowserStorage() {
|
||||
export function useBrowserModelFactory() {
|
||||
return useCallback((settings: AppSettings) => {
|
||||
const provider = createAIProvider(settings);
|
||||
return aisdk(provider(settings.aiModel!));
|
||||
const modelId = settings.aiModel;
|
||||
if (!modelId) {
|
||||
throw new Error("AI model is not configured");
|
||||
}
|
||||
// TODO: remove as any when @openai/agents-extensions 0.3.8 is released
|
||||
return aisdk(provider(modelId) as any);
|
||||
}, []);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import type { AppSettings } from "@aipexstudio/aipex-core";
|
||||
import { SettingsPage } from "@aipexstudio/aipex-react";
|
||||
import { I18nProvider } from "@aipexstudio/aipex-react/i18n/context";
|
||||
import type { Language } from "@aipexstudio/aipex-react/i18n/types";
|
||||
import { ThemeProvider } from "@aipexstudio/aipex-react/theme/context";
|
||||
import type { Theme } from "@aipexstudio/aipex-react/theme/types";
|
||||
import { ChromeStorageAdapter } from "@aipexstudio/browser-runtime";
|
||||
import React from "react";
|
||||
import type { LanguageModel } from "ai";
|
||||
import { generateText } from "ai";
|
||||
import React, { useCallback } from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { chromeStorageAdapter } from "../../hooks";
|
||||
import { createAIProvider } from "../../lib/ai-provider";
|
||||
|
||||
import "../tailwind.css";
|
||||
|
||||
@@ -14,7 +18,32 @@ const i18nStorageAdapter = new ChromeStorageAdapter<Language>();
|
||||
const themeStorageAdapter = new ChromeStorageAdapter<Theme>();
|
||||
|
||||
function OptionsPageContent() {
|
||||
return <SettingsPage storageAdapter={chromeStorageAdapter} />;
|
||||
const handleTestConnection = useCallback(async (settings: AppSettings) => {
|
||||
try {
|
||||
const provider = createAIProvider(settings);
|
||||
const modelId = settings.aiModel;
|
||||
if (!modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
await generateText({
|
||||
model: provider(modelId) as LanguageModel,
|
||||
prompt: "Hi",
|
||||
});
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error("Connection test failed:", error);
|
||||
return false;
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<SettingsPage
|
||||
storageAdapter={chromeStorageAdapter}
|
||||
onTestConnection={handleTestConnection}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
@@ -16,7 +16,8 @@ import {
|
||||
async function main() {
|
||||
console.log("🤖 AIPex Core - Basic Example\n");
|
||||
|
||||
const model = aisdk(google("gemini-2.5-flash"));
|
||||
// TODO: remove as any when @openai/agents-extensions 0.3.8 is released
|
||||
const model = aisdk(google("gemini-2.5-flash") as any);
|
||||
|
||||
// Example 1: Simple one-shot execution
|
||||
console.log("📝 Example 1: Simple Calculation (No Session)");
|
||||
|
||||
@@ -16,7 +16,8 @@ async function main() {
|
||||
|
||||
const agent = AIPex.create({
|
||||
instructions: "You are a helpful assistant that remembers conversations.",
|
||||
model: aisdk(openai("gpt-4o")),
|
||||
// TODO: remove as any when @openai/agents-extensions 0.3.8 is released
|
||||
model: aisdk(openai("gpt-4o") as any),
|
||||
conversationManager: manager,
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ async function demonstrateMetrics() {
|
||||
const agent = AIPex.create({
|
||||
name: "MetricsDemo",
|
||||
instructions: "You are a helpful assistant that demonstrates metrics.",
|
||||
model: aisdk(openai("gpt-4o")),
|
||||
// TODO: remove as any when @openai/agents-extensions 0.3.8 is released
|
||||
model: aisdk(openai("gpt-4o") as any),
|
||||
maxTurns: 10,
|
||||
conversationManager: manager,
|
||||
});
|
||||
|
||||
@@ -47,16 +47,16 @@
|
||||
"zod": "^4.1.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ai-sdk/google": "^2.0.44",
|
||||
"@ai-sdk/openai": "^2.0.75",
|
||||
"@ai-sdk/google": "^3.0.6",
|
||||
"@ai-sdk/openai": "^3.0.8",
|
||||
"@types/node": "^24.10.1",
|
||||
"dotenv": "^17.2.3",
|
||||
"tsx": "^4.21.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ai-sdk/anthropic": "^2.0.0",
|
||||
"@ai-sdk/google": "^2.0.0",
|
||||
"@ai-sdk/openai": "^2.0.0",
|
||||
"@ai-sdk/anthropic": "^3.0.0",
|
||||
"@ai-sdk/google": "^3.0.0",
|
||||
"@ai-sdk/openai": "^3.0.0",
|
||||
"@openrouter/ai-sdk-provider": "^0.4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// AI SDK
|
||||
export { aisdk } from "@openai/agents-extensions";
|
||||
|
||||
// Agent
|
||||
export { AIPex } from "./agent/index.js";
|
||||
|
||||
|
||||
958
pnpm-lock.yaml
generated
958
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user