Skip to content

support PBB app feature types in manifest and prompts#165

Merged
oricho123 merged 2 commits into
masterfrom
feat/orila/dynamic-pbb-app-feature-types
May 10, 2026
Merged

support PBB app feature types in manifest and prompts#165
oricho123 merged 2 commits into
masterfrom
feat/orila/dynamic-pbb-app-feature-types

Conversation

@oricho123
Copy link
Copy Markdown
Contributor

@oricho123 oricho123 commented May 7, 2026

Summary

Currently AppFeatureType is a hardcoded TypeScript enum used as the source-of-truth list of valid feature types in three places:

  • ManifestFeatureSchema.type (z.nativeEnum) - rejects PBB-only types in app-manifest.yml
  • chooseAppFeatureType interactive prompt - never offers PBB types
  • app-features:create validity check - same

This PR makes the runtime set of valid types enum ∪ active PBB types by fetching https://monday-apps-ms.monday.com/apps_ms/public/platform-building-blocks-schemas (same endpoint already consumed by monday-mcp), filtering status === 'ACTIVE', and exposing the merged list via getValidAppFeatureTypes().

The static enum is intentionally unchanged - all existing typed references (AppFeatureType.AppFeatureOauth, excludeTypes: AppFeatureType[], etc.) keep working. Manifest data validation and manifest field shape are untouched - this PR only widens what type strings are accepted.

What changed

  • New src/services/pbb-schema-manager.ts - singleton, in-memory 2h cache, single in-flight promise, 5s timeout. Network failures are logged at debug level and the manager returns an empty list, so the CLI degrades to enum-only validation when offline.
  • New src/services/app-feature-types-service.ts - getValidAppFeatureTypes() returns the deduped union.
  • New URL helper platformBuildingBlocksSchemasUrl() in src/consts/urls.ts.
  • Updated ManifestFeatureSchema.type from z.nativeEnum(AppFeatureType) to a z.string().refine(...) against the runtime list.
  • Updated readManifestFile is now async and awaits pbbSchemaManager.initialize() before parse. Three callers updated: apps-service.cloneAppTemplateAndLoadManifest, app/deploy.ts, and the manifest-service test.
  • Updated chooseAppFeatureType initialises the manager and lists merged types; param widened to Array<AppFeatureType | string>.
  • Updated app-features:create validity check uses the merged list (still rejects AppFeatureOauth).

Backwards compatibility

Scenario Before After
Manifest with enum-only feature types accepted accepted
Manifest with PBB-only feature types rejected accepted when endpoint reachable; rejected offline
Manifest with garbage type string rejected rejected
CLI run offline / endpoint down sync enum check enum-only refine after silent debug log (same effective behavior for legacy types)
Interactive prompt list static enum enum ∪ live PBB names

Test plan

  • npm run build clean
  • npm run lint clean (0 new errors; 23 pre-existing warnings unchanged)
  • npx jest 43/43 passing, including app:create integration test that exercises cloneAppTemplateAndLoadManifest -> readManifestFile -> feature creation
  • Manual: mapps app:create from a manifest using a PBB-only type (e.g. AppFeatureMenuItem, AppFeatureSkill, AppFeatureAiTeammate) imports successfully
  • Manual: same manifest with network blocked still works for legacy/enum types
  • Manual: mapps app-features:create interactive prompt lists PBB types alongside enum entries

https://monday.monday.com/boards/3670992828/pulses/11970753969

Made with Cursor

Fetch active types from /apps_ms/public/platform-building-blocks-schemas
at runtime and merge with the static AppFeatureType enum so manifests can
declare PBB-only types (incl. action-family blocks) without enum maintenance.
Falls back to enum-only when the endpoint is unreachable.

Co-authored-by: Cursor <cursoragent@cursor.com>
@oricho123 oricho123 requested a review from Shaharshaki2 May 10, 2026 07:20
@oricho123 oricho123 added the enhancement New feature or request label May 10, 2026
@oricho123 oricho123 merged commit 4c5e2fb into master May 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants