[FE chore] Move secrets and tools to monorepo packages#4338
Draft
ardaerzin wants to merge 13 commits into
Draft
Conversation
…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
… hook to @agenta/shared
…gatewayTool and @agenta/entity-ui/gatewayTool
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Contributor Resources