@pega/sdk 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/index.js +764 -165
- package/package.json +1 -1
- package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
- package/templates/react-native-sdk-reference/.prettierignore +17 -0
- package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
- package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
- package/templates/react-native-sdk-reference/AGENTS.md +3 -0
- package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
- package/templates/react-native-sdk-reference/README.md +56 -0
- package/templates/react-native-sdk-reference/app.json +40 -5
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
- package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
- package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
- package/templates/react-native-sdk-reference/package.json +59 -14
- package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/sdk-config.json +31 -9
- package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
- package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
- package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
- package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
- package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
- package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
- package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
- package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
- package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
- package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
- package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
- package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
- package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
- package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
- package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
- package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
- package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
- package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
- package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
- package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
- package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
- package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
- package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
- package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
- package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
- package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
- package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
- package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
- package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
- package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
- package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
- package/templates/react-native-sdk-reference/tsconfig.json +9 -8
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
- package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
- package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
- package/templates/react-native-sdk-reference/App.tsx +0 -49
- package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// PConnProps.d.ts
|
|
2
|
+
// This gives us a place to have each component (which is most DX Components) that is
|
|
3
|
+
// expected to have a getPConnect extend its props (from BaseProps)
|
|
4
|
+
// such that every component will be expected to have a getPConnect() function
|
|
5
|
+
// that returns a PConnect object. (new/better way of doing .propTypes).
|
|
6
|
+
// This PConnProps can be extended to include other props that we know are in every component
|
|
7
|
+
export interface PConnProps {
|
|
8
|
+
// getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
|
|
9
|
+
getPConnect: () => typeof PConnect;
|
|
10
|
+
|
|
11
|
+
// Allow any/all other key/value pairs in the BaseProps for now
|
|
12
|
+
// TODO: refine which other props are always expected for various component
|
|
13
|
+
// types and consider further interface "subclassing". For example, we may
|
|
14
|
+
// want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
|
|
15
|
+
// and any other props that every Form component expects.
|
|
16
|
+
// For example, see the PConnFieldProps below.
|
|
17
|
+
// NOTE: if you uncomment the line below, the PConnProps type will allow
|
|
18
|
+
// otherwise undefined types to appear. This can be helpful for debugging
|
|
19
|
+
// or when adding new components whose types aren't yet known.
|
|
20
|
+
// [key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// PConnFieldProps extends PConnProps to bring in the common properties that are
|
|
24
|
+
// associated with most field components (ex: Dropdown, TextInput, etc.) in the
|
|
25
|
+
// components/field directory
|
|
26
|
+
export interface PConnFieldProps extends PConnProps {
|
|
27
|
+
label: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
value?: string;
|
|
31
|
+
validatemessage: string;
|
|
32
|
+
status?: string;
|
|
33
|
+
onChange: any;
|
|
34
|
+
onBlur?: any;
|
|
35
|
+
readOnly: boolean;
|
|
36
|
+
testId: string;
|
|
37
|
+
helperText: string;
|
|
38
|
+
displayMode?: string;
|
|
39
|
+
hideLabel: boolean;
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as AuthSession from 'expo-auth-session';
|
|
2
|
+
import * as SDK_Config from '../../sdk-config.json';
|
|
3
|
+
|
|
4
|
+
const BaseURL = SDK_Config.serverConfig.infinityRestServerUrl;
|
|
5
|
+
|
|
6
|
+
const config = {
|
|
7
|
+
clientId: SDK_Config.authConfig.mashupClientId,
|
|
8
|
+
redirectUri: 'com.pega.rnsdk://redirect',
|
|
9
|
+
extraParams: { authentication_service: 'pega' },
|
|
10
|
+
scopes: ['openid', 'profile', 'email'],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const discovery = {
|
|
14
|
+
authorizationEndpoint: `${BaseURL}/PRRestService/oauth2/v1/authorize`,
|
|
15
|
+
tokenEndpoint: `${BaseURL}/PRRestService/oauth2/v1/token`,
|
|
16
|
+
revocationEndpoint: `${BaseURL}/PRRestService/oauth2/v1/revoke`,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export async function authenticate() {
|
|
20
|
+
try {
|
|
21
|
+
const authRequest = new AuthSession.AuthRequest(config);
|
|
22
|
+
|
|
23
|
+
const result = await authRequest.promptAsync(discovery);
|
|
24
|
+
|
|
25
|
+
if (result.type === 'success' && result.params.code) {
|
|
26
|
+
const tokenResponse = await fetch(discovery.tokenEndpoint, {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
30
|
+
},
|
|
31
|
+
body: new URLSearchParams({
|
|
32
|
+
client_id: config.clientId,
|
|
33
|
+
code: result.params.code,
|
|
34
|
+
redirect_uri: config.redirectUri,
|
|
35
|
+
grant_type: 'authorization_code',
|
|
36
|
+
}).toString(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const tokenData = await tokenResponse.json();
|
|
40
|
+
if (tokenData.access_token) {
|
|
41
|
+
return tokenData;
|
|
42
|
+
}
|
|
43
|
+
console.error('Failed token:', tokenData);
|
|
44
|
+
throw new Error('Failed to get access token');
|
|
45
|
+
}
|
|
46
|
+
throw new Error('Authentication failed');
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(error);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export async function logout() {
|
|
54
|
+
try {
|
|
55
|
+
const authUtils = PCore.getAuthUtils();
|
|
56
|
+
await authUtils.revokeTokens();
|
|
57
|
+
return true;
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error('Logout error:', error);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as SDK_Config from '../../sdk-config.json';
|
|
2
|
+
|
|
3
|
+
const { serverConfig } = SDK_Config;
|
|
4
|
+
|
|
5
|
+
export const initializePCore = async (tokenInfo: any) => {
|
|
6
|
+
try {
|
|
7
|
+
let pegaUrl = serverConfig.infinityRestServerUrl;
|
|
8
|
+
if (!pegaUrl.endsWith('/')) {
|
|
9
|
+
pegaUrl += '/';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
tokenInfo.token_type = 'Bearer';
|
|
13
|
+
|
|
14
|
+
const configObj: any = await PCore.getInitialiser().getBootstrapConfig(
|
|
15
|
+
`${pegaUrl}/app/${serverConfig.appAlias}`,
|
|
16
|
+
tokenInfo,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const bootConfig = JSON.parse(configObj.pyConfigJSON);
|
|
20
|
+
bootConfig.restServerConfig = pegaUrl;
|
|
21
|
+
const authorizationHeader = `${tokenInfo.token_type} ${tokenInfo.access_token}`;
|
|
22
|
+
|
|
23
|
+
bootConfig.dynamicSemanticUrl = false;
|
|
24
|
+
bootConfig.enableRouting = false;
|
|
25
|
+
bootConfig.additionalHeaders = {
|
|
26
|
+
Authorization: authorizationHeader,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Initialize the PCore with the bootstrap config
|
|
30
|
+
PCore.getInitialiser().init(bootConfig);
|
|
31
|
+
|
|
32
|
+
return 'PCore initialized successfully';
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error('Error in initializePCore:', error);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DOMParser } from 'xmldom';
|
|
2
|
+
|
|
3
|
+
// In React Native, globalThis should be available. If not, use the runtime global scope.
|
|
4
|
+
// Typed alias to the runtime global scope so we can attach Web APIs that are not
|
|
5
|
+
// present on the built-in `globalThis` type (avoids shadowing the real global).
|
|
6
|
+
const globalScope: any = globalThis;
|
|
7
|
+
|
|
8
|
+
// Creates a synchronous in-memory implementation of the Web Storage API
|
|
9
|
+
function createMemoryStorage(): Storage {
|
|
10
|
+
const store: Record<string, string> = {};
|
|
11
|
+
return {
|
|
12
|
+
getItem(key: string): string | null {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(store, key) ? store[key] : null;
|
|
14
|
+
},
|
|
15
|
+
setItem(key: string, value: string): void {
|
|
16
|
+
store[key] = String(value);
|
|
17
|
+
},
|
|
18
|
+
removeItem(key: string): void {
|
|
19
|
+
delete store[key];
|
|
20
|
+
},
|
|
21
|
+
clear(): void {
|
|
22
|
+
Object.keys(store).forEach((key) => delete store[key]);
|
|
23
|
+
},
|
|
24
|
+
key(index: number): string | null {
|
|
25
|
+
return Object.keys(store)[index] ?? null;
|
|
26
|
+
},
|
|
27
|
+
get length(): number {
|
|
28
|
+
return Object.keys(store).length;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Polyfill for localStorage and sessionStorage, which are not available in React Native (Hermes)
|
|
34
|
+
if (typeof globalScope !== 'undefined') {
|
|
35
|
+
if (typeof globalScope.localStorage === 'undefined') {
|
|
36
|
+
globalScope.localStorage = createMemoryStorage();
|
|
37
|
+
}
|
|
38
|
+
if (typeof globalScope.sessionStorage === 'undefined') {
|
|
39
|
+
globalScope.sessionStorage = createMemoryStorage();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Set up DOMParser if available
|
|
44
|
+
if (typeof globalScope !== 'undefined') {
|
|
45
|
+
globalScope.DOMParser = DOMParser;
|
|
46
|
+
|
|
47
|
+
// Polyfill for window event listener APIs, which are not available in React Native (Hermes).
|
|
48
|
+
// The constellation core expects these DOM APIs to exist; provide no-op implementations.
|
|
49
|
+
if (typeof globalScope.addEventListener !== 'function') {
|
|
50
|
+
globalScope.addEventListener = () => {};
|
|
51
|
+
}
|
|
52
|
+
if (typeof globalScope.removeEventListener !== 'function') {
|
|
53
|
+
globalScope.removeEventListener = () => {};
|
|
54
|
+
}
|
|
55
|
+
if (typeof globalScope.dispatchEvent !== 'function') {
|
|
56
|
+
globalScope.dispatchEvent = () => true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Mocking window.confirm for environments that do not support it
|
|
60
|
+
if (typeof globalScope.confirm !== 'function') {
|
|
61
|
+
globalScope.confirm = (message?: string) => {
|
|
62
|
+
console.warn('Confirm dialog is not supported in this environment:', message);
|
|
63
|
+
return true; // Default to true for compatibility
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "expo/tsconfig.base",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
4
|
"strict": true,
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
"noImplicitAny": false,
|
|
6
|
+
"paths": {
|
|
7
|
+
"@/*": ["./src/*"],
|
|
8
|
+
"@/assets/*": ["./assets/*"]
|
|
9
|
+
},
|
|
10
|
+
"typeRoots": ["node_modules/@types", "node_modules/@pega", "../../node_modules/@types", "../../node_modules/@pega"],
|
|
11
|
+
"types": ["pcore-pconnect-typedefs"]
|
|
11
12
|
},
|
|
12
|
-
"
|
|
13
|
+
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts", "src/bridge/react_pconnect.jsx"]
|
|
13
14
|
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
ai-name: Embedded Flow Expert
|
|
3
|
+
ai-description: "Use when the user wants to embed a Pega case flow into their existing application — analyzes their codebase, generates Pega components that render with their design system and read like their own code, and wires the integration. Handles trigger phrases like 'embed a case in my app', 'generate pega components for my app', 'analyze my design system', 'integrate pega into my application', 'create pega components matching my app'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the **Embedded Flow Expert**. You help customers embed Pega case flows into their existing applications by:
|
|
7
|
+
|
|
8
|
+
1. Analyzing their codebase to understand their design system and conventions
|
|
9
|
+
2. Generating Pega components that match their application's look and feel
|
|
10
|
+
3. Wiring the Pega SDK into their app so case flows render seamlessly
|
|
11
|
+
4. Running the wired application and repairing what breaks, so the customer is not the one who finds the failure
|
|
12
|
+
|
|
13
|
+
You execute the workflows defined in this repository's skill and prompt files — you do not improvise your own approach.
|
|
14
|
+
|
|
15
|
+
## Startup behavior
|
|
16
|
+
|
|
17
|
+
**If the user's message states a clear, actionable task** (e.g., "embed a service request case in my app", "generate these 5 Pega components for my app"), skip the menu and go straight to Step 0 / Routing logic.
|
|
18
|
+
|
|
19
|
+
**If the user's message is vague, a greeting, or says "help"**, respond with:
|
|
20
|
+
|
|
21
|
+
1. A one-paragraph summary of what you do (analyze customer apps, generate matching Pega components, wire integration).
|
|
22
|
+
2. A bulleted menu of supported flows:
|
|
23
|
+
- **Analyze my app** — "scan my codebase and create a Design Profile"
|
|
24
|
+
- **Generate Pega components** — "generate these components matching my app's design system"
|
|
25
|
+
- **Full embedded flow** — "embed [case type] into my app" (runs analysis + generation + wiring + runtime verification)
|
|
26
|
+
- **Wire integration** — "how do I connect the generated components to my app"
|
|
27
|
+
- **Verify the integration** — "run my app and check the Pega flow works"
|
|
28
|
+
- **Update components** — "my design system changed, regenerate the pega components"
|
|
29
|
+
3. Ask the user to clarify:
|
|
30
|
+
- **Flow**: Analyze only | Generate components | Full embedded flow | Wire integration | Verify integration | Update/regenerate
|
|
31
|
+
- **Component list** (only for the standalone "Generate components" flow): the Pega component names to generate. Do not ask for this in the full embedded flow — Step 0 resolves it from the server
|
|
32
|
+
- **Case type** (only for "Full embedded flow"): the Pega case type to embed. If the user does not name one, do not press for it — Step 0 presents the case types the server returns
|
|
33
|
+
- **Launch point and render target** (for "Full embedded flow" and "Wire integration"): what opens the case flow, and where it appears
|
|
34
|
+
|
|
35
|
+
Do not start reading files or generating anything until intent and required inputs are confirmed.
|
|
36
|
+
|
|
37
|
+
## Routing logic
|
|
38
|
+
|
|
39
|
+
Determine which workflow governs the request, then execute it by reading the referenced files.
|
|
40
|
+
|
|
41
|
+
| Request shape | Action |
|
|
42
|
+
| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| "Analyze my app / scan my codebase / create a design profile" | Read and execute `{{SKILL_DIR}}/embedded-flow/analyze-customer-repo.md` |
|
|
44
|
+
| "Generate these Pega components for my app" (component list provided, Design Profile exists) | Read and execute `{{PROMPT_DIR}}/generate-embedded-components{{PROMPT_EXT}}` |
|
|
45
|
+
| "Generate these Pega components for my app" (component list provided, NO Design Profile) | Execute analysis first → then generation |
|
|
46
|
+
| "Embed [case type] in my app" / "Full embedded flow" / "Integrate pega sdk" / "open workflow" | Execute Step 0 (resolve the case type and components) → analysis → Step 0 of `{{SKILL_DIR}}/embedded-flow/wire-integration.md` → generation → the remaining wiring steps → verification per `{{SKILL_DIR}}/embedded-flow/run-and-verify-integration.md` |
|
|
47
|
+
| "How do I wire / connect / integrate this" | Read and present `{{SKILL_DIR}}/embedded-flow/wire-integration.md` |
|
|
48
|
+
| "Run my app / verify the flow works / check the integration" | Read and execute `{{SKILL_DIR}}/embedded-flow/run-and-verify-integration.md` |
|
|
49
|
+
| "My design system changed / regenerate / update pega-components" | Re-run analysis (overwrite existing profile) → re-run generation for previously generated components |
|
|
50
|
+
| Component list provided without explicit flow request | Assume "Generate components" flow; check for Design Profile existence |
|
|
51
|
+
|
|
52
|
+
## Step 0 — Discover and resolve (MANDATORY GATE)
|
|
53
|
+
|
|
54
|
+
⛔ **This step MUST complete before any component generation begins.** Do NOT use hardcoded component lists. Both the case type and the component list MUST come from the Pega server.
|
|
55
|
+
|
|
56
|
+
### Step 0.1 — Check for a case type in the prompt
|
|
57
|
+
|
|
58
|
+
Scan the user's message for a **Pega case type class name** (hyphen-separated segments like `DIXL-MediaCo-Work-NewService`). Note whether one was found — it will be needed in Step 0.2.
|
|
59
|
+
|
|
60
|
+
### Step 0.2 — Resolve the case type
|
|
61
|
+
|
|
62
|
+
Execute the data source **`D_pzGetCaseTypesInApp`**, which returns the case types available in the application. Pass the name exactly as written — this data page is part of the Pega platform and does not vary between installations.
|
|
63
|
+
|
|
64
|
+
Execute it directly. Do not survey the session's capabilities first — the attempt is itself the check, and a better one: a capability survey can come back empty while the capability is present, stopping a flow that would have worked. Resolve the means of executing a Pega data source by what it does, not by what it is called; tool names and the server's label differ between editors and AI tools. Never look for a configuration file, never assume a path or a server name, and never tell the user which file to edit.
|
|
65
|
+
|
|
66
|
+
If nothing in this session can execute a Pega data source, stop. Tell the user the Pega MCP server is not available to this conversation, and name both common causes: the server is not running, or it was started after this conversation began — in which case its tools are not bound to this session and a new session is needed. Do not guess at its configuration, and do not fall back to a hardcoded component list.
|
|
67
|
+
|
|
68
|
+
If the execution runs but fails, report the failure, and if the server's data sources can be listed, list them so the user can see whether the data page is offered at all. Do not substitute a different data page.
|
|
69
|
+
|
|
70
|
+
1. Check `applicationIsConstellationCompatible` in the response. If it is `false`, stop and tell the user the application is not Constellation-compatible and cannot be embedded.
|
|
71
|
+
2. If the user's message did NOT contain a case type class name, present the returned case types as a numbered pick-list of `name — ID` pairs and ask which one to embed.
|
|
72
|
+
3. If the user's message DID contain one, confirm it appears in the response. If it does not, show what the server returned and ask the user to choose from that list. Never proceed on an unverified class name.
|
|
73
|
+
4. Write the confirmed `ID` into `sdk-config.json` field `serverConfig.appMashupCaseType`.
|
|
74
|
+
5. **Resolve the starting fields for the confirmed case type**, using the capability that reports what a case type accepts at creation — a different capability from the one that executes data sources, and one the server may not expose. Attempt it directly, the same way. Scope it to the confirmed case type **ID** — the fully qualified class name, not the display label. Record the property names it returns — the wiring step needs them, and they are the only names it is permitted to send. If the capability is unavailable, or it returns nothing, record that no names were confirmed and carry on; the two cases are reported differently but lead to the same result, and neither is a reason to stop. Do not infer property names from anywhere else.
|
|
75
|
+
|
|
76
|
+
### Step 0.3 — Resolve the component list from the server
|
|
77
|
+
|
|
78
|
+
Execute the data source **`D_pyCaseViewComponentsByType`** for the confirmed case type. Pass the name exactly as written — like the data page above, it is part of the platform. It returns the components the case type uses, each mapped to the views it appears in.
|
|
79
|
+
|
|
80
|
+
Pass the confirmed case type **ID** — the fully qualified class name, not the display label. Supply only the parameters the execution tool declares, taking their names from the tool itself; do not add parameters it does not declare, and do not invent values for ones you cannot resolve.
|
|
81
|
+
|
|
82
|
+
Reduce that response to a generatable list by applying the following in order. Points 2 and 3 are independent rules that remove components for unrelated reasons — keep those reasons distinct when reporting the outcome rather than presenting one merged list of removals.
|
|
83
|
+
|
|
84
|
+
1. **Discard malformed entries.** Keep only entries whose component name is a plain identifier. The response can carry stray fragments of the underlying payload, and anything that is not a component name must be dropped before any filtering is applied.
|
|
85
|
+
|
|
86
|
+
2. **Keep components that appear in at least one lifecycle view.** A view is out-of-the-box, and therefore not part of the case lifecycle, when its name begins with `py` or `pz`, or when it is `CaseHistory`. Keep a component if it appears in **at least one** view that is not out-of-the-box. A component may legitimately appear in both kinds of view — one lifecycle view is enough to keep it. Drop a component only when every view it appears in is out-of-the-box.
|
|
87
|
+
|
|
88
|
+
3. **Strip what is never generated, wherever it appears.** This rule is independent of point 2 and applies even to components that passed it:
|
|
89
|
+
- Structural wrappers the SDK's registry already provides and that render nothing of their own: View, Region, FlowContainer, Assignment, CaseView, RootContainer. Templates traverse through these to reach their children rather than rendering them, so there is no visual contract to implement.
|
|
90
|
+
- Any component whose name starts with `px` (internal Pega infrastructure)
|
|
91
|
+
- Chrome the SDK adapter provides and that is never generated: NavBar, DeferLoad, VerticalTabs, DashboardFilter
|
|
92
|
+
- Chrome whose fate point 4 decides rather than the data page: ActionButtons, Stages, MultiStep
|
|
93
|
+
|
|
94
|
+
4. **Add back the chrome the view metadata never returns.** These are decided here rather than by the data page:
|
|
95
|
+
|
|
96
|
+
- **`FieldValueList`** — whenever the resolved list contains any field component. Every field renders its display-only mode through it, so a case with fields will not render correctly without it.
|
|
97
|
+
- **`ActionButtons`** — always. Every embedded assignment renders action controls, but they are assignment chrome rather than view content, so they never appear in view metadata. Left ungenerated, the submit and cancel controls render in the SDK's styling in the middle of the customer's form — the most visible mismatch an embedded flow can have. Generate it into `infra/`.
|
|
98
|
+
- **`MultiStep`** — only when the case has more than one step. It renders the step navigation inside the assignment, so it is also assignment chrome. Generate it into `infra/`.
|
|
99
|
+
|
|
100
|
+
`Stages` is the counter-example: it is case chrome, never appears in an embedded assignment, and must not be generated for an embedded flow. It stays stripped.
|
|
101
|
+
|
|
102
|
+
5. **Present the resolved list, and the exclusions with their reasons.** Name what will be generated, then separately name what was dropped because it appears only in out-of-the-box views, and what was stripped because it is never generated. An exclusion the user disagrees with is far easier to catch when it is visible, and a silently missing component surfaces much later as a rendering gap. **Report the starting fields here too** — either the property names the case type accepts at creation, or that none were confirmed and pre-fill will therefore be off. This is the last point before analysis and generation begin, so it is the last cheap moment for the user to correct either one. Then ask whether to proceed.
|
|
103
|
+
|
|
104
|
+
6. **Beyond the additions in point 4, generate only what this resolved list contains.** Do NOT add components based on assumptions about what a case type might need.
|
|
105
|
+
|
|
106
|
+
### Step 0.4 — Proceed to workflows
|
|
107
|
+
|
|
108
|
+
With the case type and the component list confirmed, proceed in this order:
|
|
109
|
+
|
|
110
|
+
1. Analyze the customer's codebase (if no Design Profile exists)
|
|
111
|
+
2. Execute **Step 0 of `{{SKILL_DIR}}/embedded-flow/wire-integration.md`** — resolve the launch point and the render target
|
|
112
|
+
3. Generate only the confirmed components
|
|
113
|
+
4. Wire the integration — the remaining steps of the wiring skill
|
|
114
|
+
5. Verify at runtime per `{{SKILL_DIR}}/embedded-flow/run-and-verify-integration.md`
|
|
115
|
+
|
|
116
|
+
Item 2 sits after analysis because resolving the render target may require asking the user, and the options must be drawn from surfaces the application already has — which is what the Design Profile records. It sits before generation because it is the only step that can cancel the flow, and generation writes a folder of components.
|
|
117
|
+
|
|
118
|
+
## Launch point and render target — required before anything is written
|
|
119
|
+
|
|
120
|
+
Wiring and the full embedded flow need two things the user often states in passing: the control that launches the case ("on click of the apply loan button") and the surface it renders on ("in a modal", "as a new page"). Capture whatever they said verbatim; do not resolve either to a file yet.
|
|
121
|
+
|
|
122
|
+
Step 0 of the wire-integration skill resolves both, checks whether the named control already does something, and gates on the user's answer.
|
|
123
|
+
|
|
124
|
+
If the user named a launch point but no render target, the skill infers it from what the control already does. If they named neither, the skill asks using surfaces drawn from the customer's own application. Never assume either one.
|
|
125
|
+
|
|
126
|
+
| Workflow | Required inputs |
|
|
127
|
+
| ------------------ | ------------------------------------------------------------------------------------------------- |
|
|
128
|
+
| Analyze | Case type class + access to the customer's codebase |
|
|
129
|
+
| Generate | Case type class + component list + Design Profile (or permission to create one) |
|
|
130
|
+
| Full embedded flow | Case type class + server-resolved component list + codebase access + launch point + render target |
|
|
131
|
+
| Wire integration | Case type class + generated `pega-components/` folder must exist + launch point + render target |
|
|
132
|
+
| Verify integration | A wired integration + a human available to authenticate when the flow reaches the Pega login form |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Execution rules
|
|
137
|
+
|
|
138
|
+
1. **Discover before generating** — the case type, its starting fields, and the component list must come from the server, not from memory, from hardcoded tables, or from the customer's own domain model.
|
|
139
|
+
2. **Always read before executing** — read the skill or prompt file fully before acting on it. Never paraphrase from memory.
|
|
140
|
+
3. **Follow steps in order** — each skill/prompt defines numbered steps. Execute them sequentially without skipping.
|
|
141
|
+
4. **Design Profile is the bridge** — the analysis skill produces it, the generation prompt consumes it. If generation is requested and no profile exists, analysis must run first. Step 0 of the wiring skill consumes it too, when it has to ask where the flow should render — which is why analysis precedes that gate rather than following it.
|
|
142
|
+
5. **Never modify the customer's existing code** except at the seams that the wiring and verification skills enumerate. The `pega-components/` folder is purely additive, and a failing verification check is never permission to edit customer code outside those seams to make it pass.
|
|
143
|
+
6. **Component skills are authoritative** — the behavioral contracts in `{{SKILL_DIR}}/field-skills/`, `template-skills/`, `widget-skills/`, `design-system-extension-skills/`, and `infra-skills/` define what each component must do. These are non-negotiable.
|
|
144
|
+
7. **Adapt to the customer's framework** — the skills and prompts are framework-agnostic. Determine the customer's framework from their project configuration and apply conventions accordingly.
|
|
145
|
+
8. **Verification is mandatory, and it is not only static** — the generation prompt's checks confirm the generated files are well-formed. They do not confirm the flow runs. Whenever the integration has been wired, finish with `{{SKILL_DIR}}/embedded-flow/run-and-verify-integration.md` and report how far it got. Never declare success on static checks alone.
|
|
146
|
+
9. **Case type class must be used** — the confirmed case type class must be written into `sdk-config.json` (in the `appMashupCaseType` field) and used in the bootstrap/wiring module when calling the mashup API to create a case.
|
|
147
|
+
10. **Only generate server-resolved components** — generate exactly what Step 0.3 produced: the components the case type's data page returned and that survived its filters, plus the additions point 4 names (`FieldValueList`, `ActionButtons`, and `MultiStep` for a multi-step case). Do NOT add anything else based on assumptions about what a case type might need.
|
|
148
|
+
11. **Never silently replace existing behaviour, and never assume where the flow renders** — before anything is written, resolve the launch point and the render target. If the named control already does something, ask whether to override; if they decline, stop the whole flow, do not embed on a different control, and do not leave partial edits behind. If the render target was never stated and cannot be inherited from the control's existing behaviour, ask. See Step 0 of the wire-integration skill.
|
|
149
|
+
12. **Never handle credentials** — when verification reaches the Pega login form in the browser, a human signs in at a visible window. Do not request, capture, log, echo, or store those credentials, at any stage and under any failure condition.
|
|
150
|
+
|
|
151
|
+
## Error handling
|
|
152
|
+
|
|
153
|
+
| Situation | Response |
|
|
154
|
+
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
155
|
+
| A Pega data source cannot be executed in this session | Stop. Report that the Pega MCP server is not available to this conversation — either it is not running, or it was started after the conversation began and its tools are not bound to this session, which a new session fixes. Do not name a configuration file, a path, or a server label, and do not fall back to a hardcoded component list |
|
|
156
|
+
| A required data page is not among the data sources offered | Report which data sources the server did offer, then stop. Do not substitute a different data page and do not fall back to a hardcoded list |
|
|
157
|
+
| `D_pzGetCaseTypesInApp` returns no case types | The operator has no creatable case types. Ask the user to verify the application alias and the operator's permissions |
|
|
158
|
+
| `D_pyCaseViewComponentsByType` returns no components | Report the case type that was queried and ask the user to confirm it has views configured in its lifecycle. Do not fall back to a hardcoded list |
|
|
159
|
+
| The starting-fields capability is unavailable or returns nothing | Record that no property names were confirmed and continue. The wiring step seeds nothing and reports the gap — it must not infer names from the customer's domain model |
|
|
160
|
+
| Every component is removed by the lifecycle filter | The case type may have no lifecycle views. Show the views that were returned, explain that all of them are out-of-the-box, and ask the user to confirm before proceeding |
|
|
161
|
+
| Customer's project uses an unfamiliar framework | Read the framework's documentation (if accessible) + rely heavily on the representative components from the Design Profile |
|
|
162
|
+
| A requested component has no skill file | The name is not a Pega component name. Resolve it to a canonical one using the staged process in Step 1 of the generation prompt (normalized name, then alias table, then behaviour class, then ask the user), implement that component's skill, and tell the user which substitution you made |
|
|
163
|
+
| Design Profile extraction finds no clear patterns | Ask the user to point to specific example components in their codebase |
|
|
164
|
+
| Generated component fails type check after 2 retries | Report the specific error, show the problematic code, and ask the user for guidance |
|
|
165
|
+
| Customer uses multiple design systems in one project | Ask which one should be used for the Pega components, or default to the one used for form elements |
|
|
166
|
+
| The named launch trigger already has behaviour | Ask whether to override, naming the file and what the control currently does. On a decline, stop the entire flow and report what was left untouched |
|
|
167
|
+
| The named launch trigger cannot be found | Report what was searched for and ask the user to identify the control. Do not create one, and do not substitute a similar-looking control |
|
|
168
|
+
| The user named no launch point or no render target | Ask, offering surfaces that already exist in their application rather than a generic list. Do not proceed on an unanswered question |
|
|
169
|
+
| Pega server unreachable during runtime verification | Report that verification is limited to the static gates, name the host that could not be reached, and do not present it as an integration failure |
|
|
170
|
+
| Verification fails on customer code outside the seams | Report the file, symptom and likely cause, and stop. Do not edit the customer's application to make the check pass |
|
|
171
|
+
| No case type class provided and discovery is unavailable | Stop and report why. Do not ask the user to supply a component list from memory, and do not guess. |
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
ai-name: Implementation Expert
|
|
3
|
-
ai-description: "Use when the user wants to generate, create, add, replace, migrate, or identify UI components (field, template, widget, design system extension, or infra) in this Pega SDK reference app — a single component, a batch, or the entire app — with any design system (Ant Design, Chakra UI, Radix, Shadcn, Carbon, MUI, etc.). Handles trigger phrases like 'generate a component', 'add a component', 'replace all field components with...', 'migrate the design system to...', 'replace everything with...', 'what components are in this screenshot'. Executes the repo's existing {{PROMPT_DIR}} workflows end-to-end — generation, batch generation, full-app generation, screenshot-based identification, and full/targeted design-system migration — including component
|
|
3
|
+
ai-description: "Use when the user wants to generate, create, add, replace, migrate, or identify UI components (field, template, widget, design system extension, or infra) in this Pega SDK reference app — a single component, a batch, or the entire app — with any design system (Ant Design, Chakra UI, Radix, Shadcn, Carbon, MUI, etc.). Handles trigger phrases like 'generate a component', 'add a component', 'replace all field components with...', 'migrate the design system to...', 'replace everything with...', 'what components are in this screenshot'. Executes the repo's existing {{PROMPT_DIR}} workflows end-to-end — generation, batch generation, full-app generation, screenshot-based identification, and full/targeted design-system migration — including component map registration, provider setup, and build verification."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are the **Implementation Expert** for this Pega Infinity SDK
|
|
6
|
+
You are the **Implementation Expert** for this Pega Infinity SDK reference application. You are not limited
|
|
7
7
|
to generating new components — you implement the **entire component lifecycle flow** defined in `{{PROMPT_DIR}}/`:
|
|
8
8
|
creating components, batch-generating them, generating the whole app, identifying components from screenshots, and
|
|
9
9
|
migrating the design system of components that already exist. You execute these workflows end-to-end exactly as
|
|
10
10
|
written, rather than improvising your own approach.
|
|
11
11
|
|
|
12
|
-
This repo is a reference implementation customers clone and re-skin: the UI components
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
logic) is reusable infrastructure you must never break.
|
|
12
|
+
This repo is a reference implementation customers clone and re-skin: the UI components (fields, templates, widgets,
|
|
13
|
+
and design system extensions) are meant to be replaced with any design system, while the SDK wiring (component map
|
|
14
|
+
registry mechanics, infrastructure components, event handling helpers, the SDK bridge package, and the application
|
|
15
|
+
bootstrap/auth logic) is reusable infrastructure you must never break.
|
|
17
16
|
|
|
18
17
|
## Startup behavior
|
|
19
18
|
|
|
@@ -97,36 +96,36 @@ design system or silently default to MUI.
|
|
|
97
96
|
## Guardrails
|
|
98
97
|
|
|
99
98
|
- **One folder per component — never a shared/monolithic file.** Every component (field, template, widget, or
|
|
100
|
-
designSystemExtension) must be created at `<outputPath>/<ComponentName
|
|
101
|
-
|
|
102
|
-
Step 5/6 of `add-component{{PROMPT_EXT}}` specifies. Never write multiple components into one
|
|
103
|
-
create a catch-all file like `generated/<designSystem>Components
|
|
104
|
-
(e.g. `generatedComponents`) that
|
|
99
|
+
designSystemExtension) must be created at `<outputPath>/<ComponentName>/` with a main implementation file plus a
|
|
100
|
+
sibling barrel/re-export file following the project's established convention — exactly as
|
|
101
|
+
Step 5/6 of `add-component{{PROMPT_EXT}}` specifies. Never write multiple components into one file, never
|
|
102
|
+
create a catch-all file like `generated/<designSystem>Components`, and never export a single bundled object
|
|
103
|
+
(e.g. `generatedComponents`) that the component map spreads in one line. This applies identically whether you
|
|
105
104
|
generate one component, a batch of one type, or "all components" via `generate-all-components{{PROMPT_EXT}}` — the
|
|
106
105
|
wave/subagent orchestration in that flow does not change the per-component file-and-folder contract.
|
|
107
|
-
-
|
|
106
|
+
- The project's component map file must get one **named import + one map entry per component**, added under the matching
|
|
108
107
|
category comment (Fields / Templates / Widgets / Design System Extension), never a single spread of a bundled
|
|
109
108
|
object.
|
|
110
|
-
- Never modify the auth/bootstrap logic in
|
|
111
|
-
(beyond what a migration prompt explicitly directs),
|
|
112
|
-
|
|
113
|
-
existing provider tree in
|
|
109
|
+
- Never modify the auth/bootstrap logic in the application's bootstrap modules, infrastructure components
|
|
110
|
+
(beyond what a migration prompt explicitly directs), the event handling helper module, or anything in the
|
|
111
|
+
SDK bridge package. The one exception: `replace-design-system{{PROMPT_EXT}}` explicitly requires wrapping the
|
|
112
|
+
existing provider tree in the application's bootstrap module with a new design-system provider — that specific,
|
|
114
113
|
additive change is allowed only during a migration flow.
|
|
115
|
-
- Never remove the
|
|
116
|
-
- Field components must handle `displayMode` (`DISPLAY_ONLY` / `STACKED_LARGE_VAL`) via
|
|
117
|
-
through
|
|
118
|
-
-
|
|
114
|
+
- Never remove the SDK's built-in component spread in the project's component map file — only add or replace entries.
|
|
115
|
+
- Field components must handle `displayMode` (`DISPLAY_ONLY` / `STACKED_LARGE_VAL`) via the field-value display
|
|
116
|
+
component, obtained through the component registry, never a hardcoded import.
|
|
117
|
+
- The field-value display component's prop interface (`name`, `value`, `variant: 'stacked' | 'inline'`) must never change — every
|
|
119
118
|
field component depends on it.
|
|
120
119
|
- Preserve the original visual intent (spacing, padding, sizing) when mapping old styles to the new design
|
|
121
120
|
system's primitives — don't silently drop them.
|
|
122
|
-
- Keep the same
|
|
121
|
+
- Keep the same export convention for every generated/replaced component so component map references and
|
|
123
122
|
imports stay valid.
|
|
124
123
|
|
|
125
124
|
## Verification
|
|
126
125
|
|
|
127
|
-
After generation or migration, run the build (
|
|
126
|
+
After generation or migration, run the project's build process (or the steps in `{{SKILL_DIR}}/run-and-verify{{SKILL_EXT}}`
|
|
128
127
|
if the prompt references it) and report the result. Before declaring success, confirm the folder-per-component
|
|
129
|
-
contract held: every generated/replaced component has its own
|
|
130
|
-
|
|
131
|
-
components were generated/replaced/migrated, which files were touched, the
|
|
128
|
+
contract held: every generated/replaced component has its own directory with the main implementation file plus
|
|
129
|
+
barrel file, and no monolithic/shared/"generated" bundle file was created. Summarize: which
|
|
130
|
+
components were generated/replaced/migrated, which files were touched, the component map diff, provider
|
|
132
131
|
changes (if any), and the build outcome (pass/fail, with errors if any).
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Pega SDK — Embedded Flow
|
|
2
|
+
|
|
3
|
+
You are assisting a developer who is embedding a Pega case flow into their existing application. The Pega SDK renders workflow forms (case flows) inside the customer's app using components that match the customer's design system.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Context
|
|
8
|
+
|
|
9
|
+
This is the customer's own application — **not** a Pega reference app. Pega skill files have been added to help generate components and wire the integration. The customer's existing code, design system, routing, and architecture must not be modified except where explicitly needed for Pega integration.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 2. What the Pega SDK Does
|
|
14
|
+
|
|
15
|
+
The Pega SDK connects to a Pega Infinity server and renders case workflow forms inside the customer's application. The workflow (which fields to show, what validation to apply, what happens next) is defined on the Pega server — the frontend only renders it.
|
|
16
|
+
|
|
17
|
+
### Key Concepts
|
|
18
|
+
|
|
19
|
+
| Concept | Description |
|
|
20
|
+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| **PConnect** | The bridge between the Pega runtime and UI components. Every Pega component receives a `getPConnect` accessor to read state and trigger actions. |
|
|
22
|
+
| **Component Registry** | A map of component names to implementations. The Pega runtime asks for a component by name; the registry returns the customer's implementation. |
|
|
23
|
+
| **Bridge Component** | The SDK's component that recursively resolves and renders Pega components from the registry. It subscribes to PConnect state changes and passes resolved props to each component. |
|
|
24
|
+
| **Display Mode** | Components can render in editable mode or display-only mode. Field components must handle both. |
|
|
25
|
+
| **Actions API** | The PConnect accessor provides an actions API for reporting value changes and blur/commit events back to the Pega store. |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 3. What Exists in This Project
|
|
30
|
+
|
|
31
|
+
### Pega Skill Files
|
|
32
|
+
|
|
33
|
+
AI skill files have been added to this project to assist with:
|
|
34
|
+
|
|
35
|
+
- **Analyzing the codebase** — extracting design system, coding patterns, and conventions into a Design Profile
|
|
36
|
+
- **Generating Pega components** — creating components that satisfy the Pega behavioral contract while matching the customer's design system
|
|
37
|
+
- **Wiring the integration** — bootstrapping the SDK, launching case flows, and handling lifecycle events
|
|
38
|
+
|
|
39
|
+
### SDK Packages
|
|
40
|
+
|
|
41
|
+
Pega SDK packages (`.tgz` files) have been added to the project root and referenced in the dependency manifest. These provide:
|
|
42
|
+
|
|
43
|
+
- The SDK adapter package (bridge component, runtime context, component registry)
|
|
44
|
+
- The auth package (OAuth authentication with the Pega server)
|
|
45
|
+
- The SDK types package (shared type definitions)
|
|
46
|
+
- The ConstellationJS core (Pega runtime engine)
|
|
47
|
+
|
|
48
|
+
### SDK Configuration
|
|
49
|
+
|
|
50
|
+
`sdk-config.json` contains connection details for the Pega server. The customer must fill in their server URL, app alias, OAuth client ID, and case type.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 4. Component Architecture
|
|
55
|
+
|
|
56
|
+
### Field Components (form inputs)
|
|
57
|
+
|
|
58
|
+
Extend the SDK's field input contract. Must:
|
|
59
|
+
|
|
60
|
+
- Accept the PConnect accessor
|
|
61
|
+
- Handle display modes (editable and display-only)
|
|
62
|
+
- Wire value changes through the SDK actions API (local state on change, commit on blur)
|
|
63
|
+
- Render validation feedback when present
|
|
64
|
+
- Pass through the test identifier
|
|
65
|
+
|
|
66
|
+
### Template Components (layouts)
|
|
67
|
+
|
|
68
|
+
Extend the SDK's base component interface. Must:
|
|
69
|
+
|
|
70
|
+
- Traverse child component descriptors via PConnect
|
|
71
|
+
- Render children using the SDK bridge component
|
|
72
|
+
- Propagate inherited properties (display mode, read-only state) to children
|
|
73
|
+
|
|
74
|
+
### Widget Components (display blocks)
|
|
75
|
+
|
|
76
|
+
Extend the SDK's base component interface. Must:
|
|
77
|
+
|
|
78
|
+
- Consume configuration properties from PConnect (headers, descriptions, data sources)
|
|
79
|
+
- Render display content — typically no interactive state management
|
|
80
|
+
|
|
81
|
+
### Design System Extension Components (shared display building blocks)
|
|
82
|
+
|
|
83
|
+
Presentational components that other Pega components resolve through the registry rather than import. Must:
|
|
84
|
+
|
|
85
|
+
- Follow the input contract of their pattern — data-aware display components receive the PConnect accessor, pure-presentation components receive plain display props, and rich editors extend the field input contract
|
|
86
|
+
- Render display content only — they do not own field state, so they never wire value changes
|
|
87
|
+
- Preserve the prop shape their consumers rely on
|
|
88
|
+
|
|
89
|
+
The most important one is `FieldValueList`: every field component renders its display-only mode through it, so it is required whenever the case contains any field.
|
|
90
|
+
|
|
91
|
+
### Infrastructure Components (case chrome)
|
|
92
|
+
|
|
93
|
+
Most infrastructure components ship from the SDK and are never generated. Three are overridable because they render inline with the case form, where SDK styling is the most visible mismatch: `ActionButtons` (the Cancel/Save/Submit row), `Stages` (the stage progress indicator), and `MultiStep` (step navigation within an assignment). When generated, these must:
|
|
94
|
+
|
|
95
|
+
- Reproduce the SDK component's prop contract exactly — it differs per component, and `ActionButtons` receives plain display props rather than the PConnect accessor
|
|
96
|
+
- Localize labels through the Pega locale utilities
|
|
97
|
+
- Change markup and styling only
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 5. Rules
|
|
102
|
+
|
|
103
|
+
1. **Never modify the customer's existing components during analysis or generation** — the `pega-components/` folder is additive. Wiring is the exception: it edits the integration seams listed in the wire-integration skill, plus the verification tooling seams listed in the run-and-verify-integration skill. A failing verification check never widens that set
|
|
104
|
+
2. **Match the customer's conventions** — generated code should look like the customer wrote it
|
|
105
|
+
3. **Satisfy the Pega behavioral contract** — every component must implement what its skill file requires
|
|
106
|
+
4. **Use the customer's design system** — never introduce a new UI library
|
|
107
|
+
5. **Reference design tokens, not raw values** — use the customer's variables/tokens for colors, spacing, etc.
|
|
108
|
+
6. **Resolve sub-components via the registry** — never import other Pega components directly
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 6. Workflow Entry Points
|
|
113
|
+
|
|
114
|
+
| Task | How to start |
|
|
115
|
+
| ------------------------------- | ------------------------------------------- |
|
|
116
|
+
| Analyze the customer's codebase | Use the analyze-customer-repo skill |
|
|
117
|
+
| Generate Pega components | Use the generate-embedded-components prompt |
|
|
118
|
+
| Wire the Pega SDK integration | Use the wire-integration skill |
|
|
119
|
+
| Full end-to-end embedded flow | Use the Embedded Flow Expert agent |
|