Skip to content

[FE chore] Move secrets and tools to monorepo packages#4338

Draft
ardaerzin wants to merge 13 commits into
mainfrom
frontend-chore/move-secrets-and-tools-to-entities
Draft

[FE chore] Move secrets and tools to monorepo packages#4338
ardaerzin wants to merge 13 commits into
mainfrom
frontend-chore/move-secrets-and-tools-to-entities

Conversation

@ardaerzin
Copy link
Copy Markdown
Contributor

Summary

tba...

Testing

Verified locally

secrets & tools are working as expected

QA follow-up

vault related features in FE and tools integrations in playground

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

ardaerzin added 10 commits May 8, 2026 14:10
…shared

- Move User, LlmProvider, llmAvailableProviders, removeEmptyFromObjects
  to @agenta/shared so package code can consume them without reaching
  back into @/oss/*.
- Add a primitive userAtom + setUserAtom in @agenta/shared/state, matching
  the projectIdAtom / sessionAtom pattern: package-readable primitive,
  populated by app code.
- Add OSS UserListener mirroring SessionListener to keep the shared atom
  synced with the rich profile state. Mounted in Providers.tsx alongside
  the existing listeners.
- Sweep OSS consumers to import directly from @agenta/shared/types
  (no thin re-exports through @/oss/lib/Types or @/oss/lib/helpers/*),
  consistent with the no-restricted-syntax lint rule for tree-shaking.
Vault-backed secret storage for LLM provider keys, scoped per project and
gated by user authentication.

Reference implementation of the entities/molecule pattern at its smallest
viable shape — query and mutation only:
  - No draft semantics
  - No imperative get/set surface
  - No isDirty tracking

Vault has no artifact-revision concept, so adding those slots would only
contribute dead methods.

The hook name (useVaultSecret) and return shape are preserved verbatim
from the legacy OSS implementation so consumer migration is an
import-path refactor rather than a rewrite. The query key
(["vault", "secrets", user?.id, projectId]) and migration atom
semantics (idempotency, logout-reset) are byte-identical with the legacy
source.

Includes a README documenting the folder shape, the explicit "no full
molecule API" decision, and the canonical homes for cross-cutting types
and atoms the package depends on.
Sweep the 9 OSS consumer files (ModelRegistry modals/drawer,
settings/Secrets, app management, custom workflow modal, evaluations,
prompts) to import useVaultSecret from @agenta/entities/secret. Same
hook name, same return shape — purely an import-path refactor.

Update ConfigureProviderDrawer to import SecretDTOProvider,
PROVIDER_KINDS, and PROVIDER_LABELS from the new secret package directly,
consistent with the no-restricted-syntax rule.

Drop the legacy barrel re-exports (./atoms/vault, ./hooks/useVaultSecret)
from web/oss/src/state/app/index.ts and update the SelectLLMProvider
example to point at the new path.

Remove the legacy OSS source:
  - web/oss/src/services/vault/
  - web/oss/src/state/app/atoms/vault.ts
  - web/oss/src/state/app/hooks/useVaultSecret.ts
  - web/oss/src/hooks/useVaultSecret.ts
  - web/oss/src/lib/helpers/llmProviders.ts
…end-chore/move-secrets-and-tools-to-entities
…gatewayTool and @agenta/entity-ui/gatewayTool
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment May 15, 2026 0:43am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Important

Review skipped

Draft detected.

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: af77a615-d6ea-4aa3-98a6-748fd29fe563

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch frontend-chore/move-secrets-and-tools-to-entities

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant