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
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/google": "^3.0.83",
"@ai-sdk/google-vertex": "^4.0.148",
"@ai-sdk/openai": "^3.0.74",
"@ai-sdk/openai-compatible": "^2.0.51",
"@ai-sdk/google": "^4.0.2",
"@ai-sdk/google-vertex": "^5.0.2",
"@ai-sdk/openai": "^4.0.2",
"@ai-sdk/openai-compatible": "^3.0.1",
"@ghostery/adblocker-playwright": "^2.18.0",
"@openrouter/ai-sdk-provider": "^2.9.1",
"ai": "^6.0.208",
"@openrouter/ai-sdk-provider": "^2.10.0",
"ai": "^7.0.4",
"chalk": "^5.6.2",
"commander": "^15.0.0",
"cross-fetch": "^4.1.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"web-ext": "^10.4.0"
},
"devDependencies": {
"@ai-sdk/google": "^3.0.83",
"@ai-sdk/google-vertex": "^4.0.148",
"@ai-sdk/openai": "^3.0.74",
"@ai-sdk/openai-compatible": "^2.0.51",
"@openrouter/ai-sdk-provider": "^2.9.1",
"@ai-sdk/google": "^4.0.2",
"@ai-sdk/google-vertex": "^5.0.2",
"@ai-sdk/openai": "^4.0.2",
"@ai-sdk/openai-compatible": "^3.0.1",
"@openrouter/ai-sdk-provider": "^2.10.0",
"@types/node": "^26.0.0",
"ollama-ai-provider-v2": "^3.6.0",
"tsx": "^4.22.4",
Expand Down
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"check:schemas": "pnpm run generate:schemas && git diff --exit-code schemas/"
},
"dependencies": {
"@ai-sdk/google": "^3.0.83",
"@ai-sdk/google-vertex": "^4.0.148",
"@ai-sdk/openai": "^3.0.74",
"@ai-sdk/openai-compatible": "^2.0.51",
"@ai-sdk/google": "^4.0.2",
"@ai-sdk/google-vertex": "^5.0.2",
"@ai-sdk/openai": "^4.0.2",
"@ai-sdk/openai-compatible": "^3.0.1",
"@ghostery/adblocker-playwright": "^2.18.0",
"@openrouter/ai-sdk-provider": "^2.9.1",
"@openrouter/ai-sdk-provider": "^2.10.0",
"@tabstack/sdk": "^2.3.0",
"ai": "^6.0.208",
"ai": "^7.0.4",
"chalk": "^5.6.2",
"commander": "^15.0.0",
"cross-fetch": "^4.1.0",
Expand Down
1,548 changes: 1,397 additions & 151 deletions packages/core/schemas/webagent-event.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions packages/core/src/tools/interactiveTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Also manages approved refs to gate fill/select/check actions.
*/

import { tool } from "ai";
import { tool, type ToolSet } from "ai";
import { z } from "zod";
import { nanoid } from "nanoid";
import { type AriaBrowser, PageAction } from "../browser/ariaBrowser.js";
Expand Down Expand Up @@ -77,7 +77,10 @@ async function fillFieldsDirectly(
return { filled, errors };
}

export function createInteractiveTools(context: InteractiveToolContext) {
export function createInteractiveTools(context: InteractiveToolContext): {
tools: ToolSet;
approvedRefs: ApprovedRefs;
} {
const approvedRefs = new ApprovedRefs();

const tools = {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/tools/planningTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* When no starting URL is provided, the planner determines the best url.
*/

import { tool } from "ai";
import { tool, type ToolSet } from "ai";
import { z } from "zod";
import { TOOL_STRINGS } from "../prompts.js";

/**
* Creates the planning tool: `create_plan` with optional `url`.
*/
export function createPlanningTools() {
export function createPlanningTools(): ToolSet {
return {
create_plan: tool({
description: TOOL_STRINGS.planning.create_plan.description,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/tools/searchTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Returns markdown that the LLM parses like any other web page.
*/

import { tool } from "ai";
import { tool, type ToolSet } from "ai";
import { z } from "zod";
import type { SearchService } from "../search/searchService.js";
import { WebAgentEventEmitter, WebAgentEventType } from "../events.js";
Expand All @@ -17,7 +17,7 @@ interface SearchToolContext {
eventEmitter: WebAgentEventEmitter;
}

export function createSearchTools(context: SearchToolContext) {
export function createSearchTools(context: SearchToolContext): ToolSet {
return {
webSearch: tool({
description: TOOL_STRINGS.webActions.webSearch.description,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/tools/tabstackTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* data extraction.
*/

import { tool } from "ai";
import { tool, type ToolSet } from "ai";
import { z } from "zod";
import type Tabstack from "@tabstack/sdk";
import { WebAgentEventEmitter, WebAgentEventType } from "../events.js";
Expand All @@ -19,7 +19,7 @@ export interface TabstackToolContext {
eventEmitter: WebAgentEventEmitter;
}

export function createTabstackTools(context: TabstackToolContext) {
export function createTabstackTools(context: TabstackToolContext): ToolSet {
return {
tabstack_extract_markdown: tool({
description: TOOL_STRINGS.tabstack.tabstack_extract_markdown.description,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/tools/validationTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* Tools for validating task completion quality.
*/

import { tool } from "ai";
import { tool, type ToolSet } from "ai";
import { z } from "zod";
import { TOOL_STRINGS } from "../prompts.js";

export function createValidationTools() {
export function createValidationTools(): ToolSet {
return {
validate_task: tool({
description: TOOL_STRINGS.validation.validate_task.description,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/tools/webActionTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Each tool includes description, inputSchema, and execute function.
*/

import { tool } from "ai";
import { tool, type ToolSet } from "ai";
import { z } from "zod";
import {
AriaBrowser,
Expand Down Expand Up @@ -297,7 +297,7 @@ async function performActionWithValidation(
);
}

export function createWebActionTools(context: WebActionContext) {
export function createWebActionTools(context: WebActionContext): ToolSet {
if (!context.agentFilledRefs || !context.operationalRefs) {
throw new Error("Web action provenance tracking sets are required");
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/webAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ type StepOutcome =
| { flow: "return"; value: { success: boolean; finalAnswer: string; error?: TaskError } }
| { flow: "next"; needsPageSnapshot: boolean };

type StreamTextResultGeneric = StreamTextResult<any, never>;
type StreamTextResultGeneric = StreamTextResult<any, any, never>;
// HACK: cobble together a type from StreamTextResult with promises resolved
type ProcessedAIResponse = AwaitedProperties<
Pick<
Expand Down
8 changes: 8 additions & 0 deletions packages/core/test/tools/planningTools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result).toEqual(input);
Expand All @@ -151,6 +152,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result.successCriteria).toBe("Test successCriteria");
Expand All @@ -169,6 +171,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result).toEqual(input);
Expand Down Expand Up @@ -197,6 +200,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result.plan).toBe(longPlan);
Expand All @@ -214,6 +218,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result.url).toBe("https://example.com/search?q=test&filter=true&page=1");
Expand All @@ -231,6 +236,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result.successCriteria).toBe("Tâche en français");
Expand Down Expand Up @@ -295,6 +301,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result).toEqual(input);
Expand All @@ -312,6 +319,7 @@ describe("Planning Tools", () => {
const result = (await tools.create_plan.execute!(input, {
toolCallId: "test",
messages: [] as ModelMessage[],
context: undefined,
})) as CreatePlanResult;

expect(result).toEqual(input);
Expand Down
6 changes: 3 additions & 3 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"test:e2e:headless": "HEADLESS=true playwright test"
},
"dependencies": {
"@ai-sdk/google": "^3.0.83",
"@ai-sdk/openai": "^3.0.74",
"@openrouter/ai-sdk-provider": "^2.9.1",
"@ai-sdk/google": "^4.0.2",
"@ai-sdk/openai": "^4.0.2",
"@openrouter/ai-sdk-provider": "^2.10.0",
"@radix-ui/react-dropdown-menu": "^2.1.18",
"@radix-ui/react-label": "^2.1.10",
"@radix-ui/react-scroll-area": "^1.2.12",
Expand Down
Loading
Loading