Skip to content

Conversation

@chromiebot
Copy link

@chromiebot chromiebot commented Jan 4, 2026

why

what changed

test plan


Summary by cubic

Exported the Tool type and tool function in the public API so users can import them from @browserbasehq/stagehand and define custom tools. Added tests to verify both exports match the upstream package.

  • New Features
    • Re-exported Tool type in packages/core/lib/v3/types/public/agent.ts.
    • Exported tool function in packages/core/lib/v3/index.ts.

Written for commit 181bc31. Summary will update on new commits.

Chromie Bot and others added 2 commits January 4, 2026 17:42
Add test to verify the Tool type from AI SDK is properly re-exported
from Stagehand. This allows users to import Tool from @browserbasehq/stagehand
instead of ai-sdk directly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Re-export the Tool type from the 'ai' package so users can import it
directly from @browserbasehq/stagehand rather than having to install
and import from ai-sdk separately.

This follows the same pattern used for ModelMessage and other AI SDK types.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2026

🦋 Changeset detected

Latest commit: 181bc31

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-evals Patch
@browserbasehq/stagehand-server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 4, 2026

Greptile Summary

Re-exports the Tool type from the AI SDK (ai package) to allow Stagehand consumers to define custom tools without requiring a direct dependency on the AI SDK. This follows the existing pattern of re-exporting ModelMessage from the same package (line 19 in agent.ts).

  • Added Tool type re-export in packages/core/lib/v3/types/public/agent.ts
  • Updated type manifest in public-types.test.ts to include the new export
  • Created dedicated test file tool-type-export.test.ts with type compatibility checks

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are minimal, well-tested, and follow existing patterns in the codebase. The PR only adds a type re-export without modifying any runtime behavior, and includes comprehensive tests to verify type compatibility.
  • No files require special attention

Important Files Changed

Filename Overview
packages/core/lib/v3/types/public/agent.ts Added Tool type re-export from AI SDK to allow consumers to define custom tools without direct dependency
packages/core/tests/public-api/public-types.test.ts Updated type manifest to include Tool type in expected exports list
packages/core/tests/public-api/tool-type-export.test.ts Added comprehensive tests verifying Tool type is correctly re-exported and matches AI SDK type

Sequence Diagram

sequenceDiagram
    participant Consumer as Stagehand Consumer
    participant Stagehand as @browserbasehq/stagehand
    participant AISDK as ai (AI SDK)

    Note over Consumer,AISDK: Before this PR
    Consumer->>AISDK: import { Tool } from "ai"
    Consumer->>Stagehand: import { AgentConfig } from "@browserbasehq/stagehand"
    Consumer->>Consumer: Define custom tools using Tool type
    Note over Consumer: Required direct dependency on "ai" package

    Note over Consumer,AISDK: After this PR
    Consumer->>Stagehand: import { Tool, AgentConfig } from "@browserbasehq/stagehand"
    Stagehand->>AISDK: Re-exports Tool type
    Consumer->>Consumer: Define custom tools using Tool type
    Note over Consumer: No direct dependency on "ai" package needed
Loading

Chromie Bot and others added 3 commits January 4, 2026 17:59
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tkattkat tkattkat closed this Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants