Skip to content

feat(sdk): add TypeScript Fern client + thin @agenta/sdk wrapper - #4259

Merged
junaway merged 16 commits into
release/v0.99.3from
feat/sdk/typescript-fern
May 7, 2026
Merged

junaway merged 16 commits into
release/v0.99.3from
feat/sdk/typescript-fern

Conversation

@mmabrouk

@mmabrouk mmabrouk commented May 4, 2026

Copy link
Copy Markdown
Member

feat(sdk): add TypeScript Fern client + thin @agenta/sdk wrapper

Mirrors the Python split (clients/python + sdks/python) on the
TypeScript side. A standalone Fern-generated TS client lives at
clients/typescript/ and joins the web/ pnpm workspace via relative
path. A thin convenience wrapper at web/packages/agenta-sdk/ re-exports
the client with a Python-style init() helper and a
getAgentaSdkClient() lazy singleton.

This PR is independent of the Python SDK reorg and the WORKDIR rename

  • it touches only web/, clients/typescript/, and .gitignore.

What changes

Adds:

  • clients/typescript/ - 1144 files, the standalone Fern-generated TS
    client
  • web/packages/agenta-sdk/ - 3 files, thin convenience wrapper
  • web/_reference/ - 126 files, legacy v2 SDK packages (agenta-sdk,
    agenta-sdk-tracing, agenta-sdk-ai, agenta-sdk-mastra) MOVED out of
    the workspace glob so they remain on disk for design lookup but
    never build

Workspace wiring:

  • web/pnpm-workspace.yaml adds ../clients/typescript
  • web/pnpm-lock.yaml regenerated

Next.js config (web/{oss,ee}/next.config.ts):

  • transpilePackages: + @agenta/sdk, + @agenta/client
  • turbopack.root and outputFileTracingRoot lifted from web/ to repo
    root, since clients/typescript/ is a sibling of web/ (Turbopack
    refuses to follow symlinks pointing outside its root)

Build script (web/{oss,ee}/package.json):

  • next build emits standalone bundle under .next/standalone/web/{oss,ee}/
    to match the new tracing root
  • version field stays at main's current release version

Fern generator config (in clients/typescript/):

  • omitFernHeaders: true - drops X-Fern-* headers the Agenta CORS
    allowlist rejects
  • includeCredentialsOnCrossOriginRequests: true - withCredentials
    baked in, so cookie-session auth works without a custom fetch wrapper
  • retainOriginalCasing: true - keep wire snake_case (matches backend,
    OpenAPI spec, and v2 entity Zod schemas)
  • browser: { fs: false, stream: false, buffer: false } and
    @types/node devDep - browser-stub Node built-ins so the client
    bundles cleanly in Next.js

First consumer migration:

  • web/packages/agenta-entities/src/testset/api/api.ts - fetchTestsetsList
    switches from raw axios.post('/testsets/query') to
    client.testsets.queryTestsets(...). Zod boundary stays.
  • web/packages/agenta-entities/package.json adds @agenta/sdk dep

.gitignore:

    • clients/typescript/dist/

Risks

  • Largest PR in the SDK family by file count (~1144 generated TS
    files). Reviewers should focus on:
    • web/packages/agenta-sdk/src/index.ts - the wrapper layer
    • web/{oss,ee}/next.config.ts - workspace config changes
    • web/packages/agenta-entities/src/testset/api/api.ts - consumer
      migration
    • clients/typescript/package.json for the generator config
  • Turbopack root change: lifting turbopack.root and
    outputFileTracingRoot to the repo root could cause unrelated files
    outside web/ to be picked up in file tracing.
  • Prettier on clients/typescript/: the existing pre-commit config
    does not exclude clients/ from prettier. Modifying a TS file in
    clients/typescript/ would trigger prettier to reformat all of it.
    Mitigation: prettier hook is idempotent on Fern output.
  • CORS / auth: includeCredentialsOnCrossOriginRequests means every
    Fern-client call sends cookies. Don't reuse the client across user
    sessions on the server side.
  • First-consumer scope: only fetchTestsetsList migrated. Rest of the
    testset API and other consumers still use raw axios. Intentional -
    one consumer to prove wiring end-to-end.

QA

  • CI green
  • pnpm install resolves cleanly across workspace
  • cd web/oss && pnpm typecheck && pnpm lint pass
  • cd web/oss && pnpm build succeeds; output at .next/standalone/web/oss/
  • Same for web/ee
  • pnpm dev --turbopack starts; testsets list page loads
  • Network tab: testsets request goes to POST /testsets/query
    with Cookie: header, no X-Fern-* headers
  • Regenerate TS client locally and diff against committed
    clients/typescript/src/ should be empty

Originally part of #4239 - split out for independent review.

@vercel

vercel Bot commented May 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Error Error May 7, 2026 9:10am

Request Review

@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label May 4, 2026
@coderabbitai

coderabbitai Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8694aea1-f49f-49be-9eb9-6bb26b903a55

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request adds an ignore entry for the distribution directory of the api-client package and introduces documentation for reference v2-era SDK packages that exist outside the pnpm workspace.

Changes

Reference Packages Structure

Layer / File(s) Summary
Configuration
.gitignore
Added entry to ignore distribution artifacts at web/packages/api-client/dist/
Documentation
web/_reference/README.md
New README documenting v2-era SDK reference packages, their purpose, status under v3, and usage constraints

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a TypeScript Fern client and thin wrapper for the SDK.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing what changes, risks, QA steps, and noting independent evolution from prior approaches.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sdk/typescript-fern

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e912f2f-d8ba-4d03-a37b-21eb6b1d3b46

📥 Commits

Reviewing files that changed from the base of the PR and between bd447c0 and a7b3786.

⛔ Files ignored due to path filters (296)
  • clients/typescript/src/generated/BaseClient.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/CreateOrganizationDomainRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/CreateOrganizationPayload.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/CreateOrganizationProviderRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/CreateWorkspace.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/DeleteOrganizationDomainRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/DeleteOrganizationProviderRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/DeleteOrganizationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/GetOrganizationDomainRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/GetOrganizationProviderRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/ListOrganizationDomainsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/ListOrganizationProvidersRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/PatchOrganizationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/ResetUserPasswordRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/TransferOrganizationOwnershipRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/UnassignRoleFromUserRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/UpdateOrganizationProviderRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/UpdateOrganizationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/UpdateWorkspace.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/UserRole.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/UserUpdate.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/VerifyOrganizationDomainRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/errors/UnprocessableEntityError.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/errors/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/accessControl/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/accessControl/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/accessControl/client/requests/VerifyPermissionsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/accessControl/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/accessControl/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/accessControl/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminAccountsCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminAccountsDeleteDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminCancelSubscriptionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminCreateCheckoutRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminCreatePortalRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteApiKeyRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteOrganizationMembershipRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteOrganizationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteProjectMembershipRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteProjectRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteUserIdentityRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteWorkspaceMembershipRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminDeleteWorkspaceRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsApiKeysCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsDeleteDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsOrganizationsCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsOrganizationsMembershipsCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsOrganizationsTransferOwnershipDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsProjectsCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsProjectsMembershipsCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsUsersCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsUsersIdentitiesCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsUsersResetPasswordDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsWorkspacesCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSimpleAccountsWorkspacesMembershipsCreateDto.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/AdminSwitchPlansRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/EntitiesRequestModel.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/admin/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/aiServices/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/aiServices/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/aiServices/client/requests/ToolCallRequestModel.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/aiServices/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/aiServices/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/aiServices/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/apiKeys/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/apiKeys/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/apiKeys/client/requests/DeleteApiKeyRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/apiKeys/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/apiKeys/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/apiKeys/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationForkRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionCommitRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionDeployRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionResolveRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionRetrieveRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationRevisionsLogRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationVariantCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ApplicationVariantEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ArchiveApplicationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ArchiveApplicationRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ArchiveApplicationVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ArchiveSimpleApplicationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/FetchApplicationCatalogPresetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/FetchApplicationCatalogTemplateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/FetchApplicationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/FetchApplicationRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/FetchApplicationVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/FetchSimpleApplicationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ListApplicationCatalogPresetsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/ListApplicationCatalogTemplatesRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/QueryApplicationVariantsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/SimpleApplicationCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/SimpleApplicationEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/SimpleApplicationQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/UnarchiveApplicationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/UnarchiveApplicationRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/UnarchiveApplicationVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/UnarchiveSimpleApplicationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/types/QueryApplicationVariantsRequestOrder.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/applications/types/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/client/requests/CheckOrganizationAccessAuthAccessGetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/client/requests/DiscoverRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/client/requests/SessionIdentitiesUpdate.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/client/requests/SsoCallbackRedirectAuthSsoCallbackOrganizationSlugProviderSlugGetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/auth/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/billing/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/billing/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/billing/client/requests/CreateCheckoutRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/billing/client/requests/SwitchPlansRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/billing/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/billing/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/billing/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/ArchiveEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/ArchiveEnvironmentRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/ArchiveEnvironmentVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/ArchiveSimpleEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentRevisionCommitRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentRevisionCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentRevisionEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentRevisionResolveRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentRevisionRetrieveRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentRevisionsLogRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentVariantCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/EnvironmentVariantEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/FetchEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/FetchEnvironmentRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/FetchEnvironmentVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/FetchSimpleEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/GuardSimpleEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/QueryEnvironmentRevisionsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/QueryEnvironmentVariantsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/QueryEnvironmentsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/SimpleEnvironmentCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/SimpleEnvironmentEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/SimpleEnvironmentQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/UnarchiveEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/UnarchiveEnvironmentRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/UnarchiveEnvironmentVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/UnarchiveSimpleEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/UnguardSimpleEnvironmentRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/types/QueryEnvironmentRevisionsRequestOrder.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/types/QueryEnvironmentVariantsRequestOrder.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/types/QueryEnvironmentsRequestOrder.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/environments/types/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/CloseEvaluationSimpleEvaluationsEvaluationIdClosePostRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/CloseRunEvaluationsRunsRunIdCloseStatusPostRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/DeleteEvaluationSimpleEvaluationsEvaluationIdDeleteRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/DeleteQueueEvaluationsQueuesQueueIdDeleteRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/DeleteResultEvaluationsResultsResultIdDeleteRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/DeleteRunEvaluationsRunsRunIdDeleteRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/DeleteScenarioEvaluationsScenariosScenarioIdDeleteRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationMetricsCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationMetricsEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationMetricsIdsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationMetricsQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationMetricsRefreshRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationQueueEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationQueueIdsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationQueueQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationQueueScenariosQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationQueuesCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationQueuesEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationResultEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationResultIdsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationResultQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationResultsCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationResultsEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationRunEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationRunQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationRunsCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationRunsEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationScenarioEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationScenarioIdsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationScenarioQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationScenariosCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/EvaluationScenariosEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/FetchEvaluationSimpleEvaluationsEvaluationIdGetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/FetchQueueEvaluationsQueuesQueueIdGetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/FetchResultEvaluationsResultsResultIdGetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/FetchRunEvaluationsRunsRunIdGetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/FetchScenarioEvaluationsScenariosScenarioIdGetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/FetchSimpleQueueRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/OpenEvaluationSimpleEvaluationsEvaluationIdOpenPostRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/OpenRunEvaluationsRunsRunIdOpenPostRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/RefreshRunsAdminEvaluationsRunsRefreshPostRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleEvaluationCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleEvaluationEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleEvaluationQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleQueueCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleQueueQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleQueueScenariosQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleQueueTestcasesCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/SimpleQueueTracesCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/StartSimpleEvaluationRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/StopEvaluationSimpleEvaluationsEvaluationIdStopPostRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluations/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/ArchiveEvaluatorRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/ArchiveEvaluatorRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/ArchiveEvaluatorVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/ArchiveSimpleEvaluatorRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorForkRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionCommitRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionDeployRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionResolveRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionRetrieveRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorRevisionsLogRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorVariantCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/EvaluatorVariantEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/FetchEvaluatorCatalogPresetRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/FetchEvaluatorCatalogTemplateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/FetchEvaluatorRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/FetchEvaluatorRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/FetchEvaluatorVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/FetchSimpleEvaluatorRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/ListEvaluatorCatalogPresetsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/ListEvaluatorCatalogTemplatesRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/ListEvaluatorTemplatesRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/QueryEvaluatorVariantsRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/SimpleEvaluatorCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/SimpleEvaluatorEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/SimpleEvaluatorQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/UnarchiveEvaluatorRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/UnarchiveEvaluatorRevisionRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/UnarchiveEvaluatorVariantRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/UnarchiveSimpleEvaluatorRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/types/QueryEvaluatorVariantsRequestOrder.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/evaluators/types/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/events/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/events/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/events/client/requests/EventQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/events/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/events/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/events/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/requests/DeleteFolderRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/requests/FetchFolderRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/requests/FolderCreateRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/requests/FolderEditRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/requests/FolderQueryRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/client/requests/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/exports.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/folders/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/observability/client/Client.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/observability/client/index.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/observability/client/requests/DeleteTraceTracingRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/observability/client/requests/EditTraceRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/observability/client/requests/EditTraceTracingRequest.ts is excluded by !**/generated/**
  • clients/typescript/src/generated/api/resources/observability/client/requests/FetchAnalyticsRequest.ts is excluded by !**/generated/**
📒 Files selected for processing (4)
  • .gitignore
  • COMMIT_MSG.txt
  • clients/typescript/README.md
  • clients/typescript/package.json

Comment thread web/packages/api-client/README.md Resolved
Mirrors the Python split (clients/python + sdks/python) on the
TypeScript side. A standalone Fern-generated TS client lives at
clients/typescript/ and joins the web/ pnpm workspace via relative
path. A thin convenience wrapper at web/packages/agenta-sdk/ re-exports
the client with a Python-style init() helper and a
getAgentaSdkClient() lazy singleton.

This PR is independent of the Python SDK reorg and the WORKDIR rename
- it touches only web/, clients/typescript/, and .gitignore.

## What changes

Adds:
- clients/typescript/ - 1144 files, the standalone Fern-generated TS
  client
- web/packages/agenta-sdk/ - 3 files, thin convenience wrapper
- web/_reference/ - 126 files, legacy v2 SDK packages (agenta-sdk,
  agenta-sdk-tracing, agenta-sdk-ai, agenta-sdk-mastra) MOVED out of
  the workspace glob so they remain on disk for design lookup but
  never build

Workspace wiring:
- web/pnpm-workspace.yaml adds ../clients/typescript
- web/pnpm-lock.yaml regenerated

Next.js config (web/{oss,ee}/next.config.ts):
- transpilePackages: + @agenta/sdk, + @agenta/client
- turbopack.root and outputFileTracingRoot lifted from web/ to repo
  root, since clients/typescript/ is a sibling of web/ (Turbopack
  refuses to follow symlinks pointing outside its root)

Build script (web/{oss,ee}/package.json):
- next build emits standalone bundle under .next/standalone/web/{oss,ee}/
  to match the new tracing root
- version field stays at main's current release version

Fern generator config (in clients/typescript/):
- omitFernHeaders: true - drops X-Fern-* headers the Agenta CORS
  allowlist rejects
- includeCredentialsOnCrossOriginRequests: true - withCredentials
  baked in, so cookie-session auth works without a custom fetch wrapper
- retainOriginalCasing: true - keep wire snake_case (matches backend,
  OpenAPI spec, and v2 entity Zod schemas)
- browser: { fs: false, stream: false, buffer: false } and
  @types/node devDep - browser-stub Node built-ins so the client
  bundles cleanly in Next.js

First consumer migration:
- web/packages/agenta-entities/src/testset/api/api.ts - fetchTestsetsList
  switches from raw axios.post('/testsets/query') to
  client.testsets.queryTestsets(...). Zod boundary stays.
- web/packages/agenta-entities/package.json adds @agenta/sdk dep

.gitignore:
- + clients/typescript/dist/

## Risks

- Largest PR in the SDK family by file count (~1144 generated TS
  files). Reviewers should focus on:
  - web/packages/agenta-sdk/src/index.ts - the wrapper layer
  - web/{oss,ee}/next.config.ts - workspace config changes
  - web/packages/agenta-entities/src/testset/api/api.ts - consumer
    migration
  - clients/typescript/package.json for the generator config
- Turbopack root change: lifting turbopack.root and
  outputFileTracingRoot to the repo root could cause unrelated files
  outside web/ to be picked up in file tracing.
- Prettier on clients/typescript/: the existing pre-commit config
  does not exclude clients/ from prettier. Modifying a TS file in
  clients/typescript/ would trigger prettier to reformat all of it.
  Mitigation: prettier hook is idempotent on Fern output.
- CORS / auth: includeCredentialsOnCrossOriginRequests means every
  Fern-client call sends cookies. Don't reuse the client across user
  sessions on the server side.
- First-consumer scope: only fetchTestsetsList migrated. Rest of the
  testset API and other consumers still use raw axios. Intentional -
  one consumer to prove wiring end-to-end.

## QA

- [ ] CI green
- [ ] pnpm install resolves cleanly across workspace
- [ ] cd web/oss && pnpm typecheck && pnpm lint pass
- [ ] cd web/oss && pnpm build succeeds; output at .next/standalone/web/oss/
- [ ] Same for web/ee
- [ ] pnpm dev --turbopack starts; testsets list page loads
- [ ] Network tab: testsets request goes to POST /testsets/query
      with Cookie: header, no X-Fern-* headers
- [ ] Regenerate TS client locally and diff against committed
      clients/typescript/src/ should be empty

Originally part of #4239 - split out for independent review.
…i-client

Reorganize the Fern-generated TS client to live INSIDE the web/ workspace
instead of as a sibling at clients/typescript/. The TS client is consumed
only by web/oss + web/ee + web/packages, so keeping it in clients/ added
cross-workspace boundary cost (Turbopack root expansion, outputFileTracingRoot
at repo root, standalone build path shift, explicit '../clients/typescript'
workspace entry) without architectural benefit. Python's clients/python/
stays put because Poetry has no shared tooling with web/.

Concretely:
- Move clients/typescript/ -> web/packages/api-client/ (git-mv preserves
  history on the 1133 generated files)
- Rename @agenta/client -> @agenta/api-client (matches dir name; clearer
  contrast with the convenience @agenta/sdk)

Reverted workarounds the move makes obsolete:
- web/oss/next.config.ts + web/ee/next.config.ts: turbopack.root and
  outputFileTracingRoot back to __dirname/.. (web/) — no need to span
  to repo root anymore
- web/oss/package.json + web/ee/package.json: build script cp paths
  back to .next/standalone/{oss,ee}/ — outputFileTracingRoot revert
  shifts the standalone layout back to its original shape
- web/pnpm-workspace.yaml: drop '../clients/typescript' entry; the
  'packages/*' glob already covers api-client
- .gitignore: clients/typescript/dist/ -> web/packages/api-client/dist/

Verified: pnpm install resolves @agenta/api-client@link:../api-client
inside the workspace; @agenta/api-client builds standalone (tsc clean);
@agenta/sdk + @agenta/entities typecheck + lint pass; next dev
--turbopack on web/ee returns HTTP 200 on /w with a single Compiled
log and no warnings; next build on web/oss completes cleanly with
.next/standalone/oss/ written to the expected path.
@junaway
junaway changed the base branch from main to release/v0.99.3 May 6, 2026 15:15
@ardaerzin
ardaerzin marked this pull request as draft May 6, 2026 15:27
ardaerzin added 3 commits May 6, 2026 19:56
…esolve

The Fern-generated client originally shipped as out-of-source
(main: ./dist/index.js + tsc build step). Switch to the in-source
pattern every other workspace package uses (main: ./src/index.ts) so
consumers can resolve imports without a separate build step.

Strip `.js` extensions from 2,039 relative imports across 751 generated
files. Fern emits NodeNext-style `from "./foo.js"` even when targeting
moduleResolution: bundler — bundlers either need an extension-alias
config (webpack) or fail to resolve outright (Turbopack via Next.js
transpilePackages). Removing the extensions makes the source bundler-
native: webpack and Turbopack both resolve `./foo` to `./foo.ts`
without per-bundler config.

If `clients/scripts/generate.sh` ever lands on this branch, the same
strip pass should run there post-generation so regenerations stay
consistent.

Verified: next build (web/oss) clean — webpack production build
succeeds without the extensionAlias workaround; next dev --turbopack
on web/ee returns HTTP 200 on /w with a single Compiled log.
…are hook

Reverts the .js-extension strip + in-source switch (846d566). After
checking the full Fern config option list, there is NO config knob
that controls import-extension emission — the .js suffixes are baked
into Fern's TypeScript SDK output. Fern's design assumes you compile
to dist/ via tsc, where the .js extensions then resolve correctly
because tsc emits the matching .js files alongside.

Stripping extensions client-side worked but was a 2,039-site hack
that would need re-running after every Fern regeneration. Better to
align with Fern's intended pattern.

Restores:
- main / module / types / exports back to ./dist/index.js (and .d.ts)
- The 2,039 .js extensions on relative imports in src/generated/

Adds:
- `prepare: tsc -p tsconfig.json` to api-client/package.json — pnpm
  runs `prepare` after `pnpm install`, so dist/ is built automatically
  whenever consumers install. This is the standard npm-lifecycle way
  to ship a workspace package that needs compilation, and avoids
  per-consumer turbo/build-graph wiring.

Verified: pnpm install triggers the prepare script (dist/ produced
with index.js + index.d.ts + generated/); next build (web/oss)
production webpack build clean; next dev --turbopack (web/ee) HTTP
200 on /w with single Compiled log.
Tells contributors when they need to run `pnpm install` or
`pnpm --filter @agenta/api-client build` after regenerating or editing
the client. Two anchor points:

- AGENTS.md "Dev Environment Tips" — short bullet covering the rebuild
  trigger so any agent / contributor reading the top-level guide sees
  it next to the existing lint-fix and tailwind-tokens reminders.

- web/packages/api-client/README.md — full context: why the package
  ships compiled dist/ (Fern emits NodeNext-style .js extensions in
  imports unconditionally; there's no Fern config knob), how the
  prepare script keeps dist/ fresh on install, when to manually
  rebuild, the regeneration command shapes, and a table of the
  non-default Fern config flags with rationale (omitFernHeaders,
  includeCredentialsOnCrossOriginRequests, retainOriginalCasing,
  browser stubs, etc.) so future regenerators know what's intentional.
@ardaerzin
ardaerzin marked this pull request as ready for review May 6, 2026 19:01
@github-actions

github-actions Bot commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-05-07T09:22:45.152Z

@junaway
junaway merged commit 48034c3 into release/v0.99.3 May 7, 2026
25 of 27 checks passed

This branch had an error being deployed

1 failed deployment
Preview — 2a4153c2 Deployed May 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature sdk size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants