Skip to content

feat(ai-proxy): export FOREST_INTEGRATION_NAMES as runtime const [PRD-375]#1588

Merged
matthv merged 1 commit into
mainfrom
feat/prd-365-export-forest-integration-names
May 20, 2026
Merged

feat(ai-proxy): export FOREST_INTEGRATION_NAMES as runtime const [PRD-375]#1588
matthv merged 1 commit into
mainfrom
feat/prd-365-export-forest-integration-names

Conversation

@matthv
Copy link
Copy Markdown
Member

@matthv matthv commented May 20, 2026

Summary

Expose Forest connector integration names as a runtime const so consumers can enumerate them without duplicating the list locally.

Change

```diff
-export type ForestIntegrationName = 'Zendesk' | 'Kolar' | 'Snowflake';
+export const FOREST_INTEGRATION_NAMES = ['Zendesk', 'Kolar', 'Snowflake'] as const;
+export type ForestIntegrationName = (typeof FOREST_INTEGRATION_NAMES)[number];
```

No behavioral change. `ForestIntegrationName` still resolves to the same literal union; existing consumers that only import the type are unaffected. New consumers can now `import { FOREST_INTEGRATION_NAMES }` to enumerate the names at runtime, with the type derived from the const for guaranteed single-source-of-truth.

Motivation

forestadmin-server PRD-365 (forestadmin-server#8249) adds a server-side guard rejecting user MCP configs whose `serverName` collides with a Forest connector name. Initial implementation mirrored the list locally via a `Record<ForestIntegrationName, true>` exhaustiveness trick. Review feedback (discussion) requested the source of truth move to ai-proxy.

Test plan

  • `yarn workspace @forestadmin/ai-proxy build` → tsc clean
  • `yarn workspace @forestadmin/ai-proxy test` → 355 pass, 0 fail (existing skips unchanged)
  • `npx eslint packages/ai-proxy/src/forest-integration-client.ts` → clean

Conflict heads-up

PR #1584 (PRD-362) touches the same file adjacent to this change (`+id?: string` on `ForestIntegrationConfig`). Conflict expected to be trivial — whichever lands first, the other rebases.

fixes PRD-375
relates to PRD-365

🤖 Generated with Claude Code

Note

Export FOREST_INTEGRATION_NAMES as a runtime constant array in ai-proxy

Adds an exported FOREST_INTEGRATION_NAMES tuple (['Zendesk', 'Kolar', 'Snowflake'] as const) to forest-integration-client.ts. The ForestIntegrationName type is now derived from this tuple via (typeof FOREST_INTEGRATION_NAMES)[number] instead of a manually maintained string-literal union, keeping the type and runtime values in sync.

Macroscope summarized 6d8ec9d.

…-365]

The Forest integration name registry was only available as a compile-time
string-union type. Exposing a runtime const lets consumers build a single
source of truth for the list of reserved names — adding a new integration
only requires touching the array, and the ForestIntegrationName type
derives from it.

Behavioral change: none. The resolved members of ForestIntegrationName are
identical to the previous literal union.

Consumed by forestadmin-server PRD-365 (server-side guard against MCP
serverName collisions with Forest connector reserved names).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented May 20, 2026

PRD-375

PRD-365

@matthv matthv marked this pull request as ready for review May 20, 2026 09:33
@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 20, 2026

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
packages/ai-proxy/src/forest-integration-client.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@matthv matthv merged commit 89f4f64 into main May 20, 2026
29 checks passed
@matthv matthv deleted the feat/prd-365-export-forest-integration-names branch May 20, 2026 09:42
forest-bot added a commit that referenced this pull request May 20, 2026
# @forestadmin/ai-proxy [1.10.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/ai-proxy@1.9.0...@forestadmin/ai-proxy@1.10.0) (2026-05-20)

### Features

* **ai-proxy:** export FOREST_INTEGRATION_NAMES as runtime const [PRD-375] ([#1588](#1588)) ([89f4f64](89f4f64))
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