@pega/sdk 0.0.13 → 0.0.15

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.
Files changed (139) hide show
  1. package/README.md +46 -6
  2. package/dist/index.js +50 -24
  3. package/package.json +42 -3
  4. package/templates/angular-sdk-reference/extra-webpack.config.cjs +23 -0
  5. package/templates/angular-sdk-reference/index.html +12 -0
  6. package/templates/angular-sdk-reference/src/app/pconnect-renderer.component.ts +153 -0
  7. package/templates/angular-sdk-reference/src/components/component-map.ts +90 -0
  8. package/templates/angular-sdk-reference/src/components/fields/auto-complete/auto-complete.component.ts +304 -0
  9. package/templates/angular-sdk-reference/src/components/fields/checkbox/checkbox.component.ts +89 -0
  10. package/templates/angular-sdk-reference/src/components/fields/currency/currency.component.ts +112 -0
  11. package/templates/angular-sdk-reference/src/components/fields/date-input/date-input.component.ts +101 -0
  12. package/templates/angular-sdk-reference/src/components/fields/dropdown/dropdown.component.ts +118 -0
  13. package/templates/angular-sdk-reference/src/components/fields/email/email.component.ts +104 -0
  14. package/templates/angular-sdk-reference/src/components/fields/integer/integer.component.ts +106 -0
  15. package/templates/angular-sdk-reference/src/components/fields/phone/phone.component.ts +104 -0
  16. package/templates/angular-sdk-reference/src/components/fields/radio-buttons/radio-buttons.component.ts +113 -0
  17. package/templates/angular-sdk-reference/src/components/fields/text-area/text-area.component.ts +111 -0
  18. package/templates/angular-sdk-reference/src/components/fields/text-input/text-input.component.ts +110 -0
  19. package/templates/angular-sdk-reference/src/components/fields/url-input/url-input.component.ts +113 -0
  20. package/templates/angular-sdk-reference/src/components/helpers/sdk-helpers.ts +93 -0
  21. package/templates/angular-sdk-reference/src/components/infra/assignment/assignment.component.ts +206 -0
  22. package/templates/angular-sdk-reference/src/components/infra/case-summary/case-summary.component.ts +75 -0
  23. package/templates/angular-sdk-reference/src/components/infra/case-view/case-view.component.ts +126 -0
  24. package/templates/angular-sdk-reference/src/components/infra/flow-container/flow-container.component.ts +411 -0
  25. package/templates/angular-sdk-reference/src/components/infra/reference/reference.component.ts +158 -0
  26. package/templates/angular-sdk-reference/src/components/infra/region/region.component.ts +39 -0
  27. package/templates/angular-sdk-reference/src/components/infra/root-container/root-container.component.ts +199 -0
  28. package/templates/angular-sdk-reference/src/components/infra/stages/stages.component.ts +89 -0
  29. package/templates/angular-sdk-reference/src/components/infra/view/view.component.ts +144 -0
  30. package/templates/angular-sdk-reference/src/components/infra/view-container/view-container.component.ts +191 -0
  31. package/templates/angular-sdk-reference/src/components/templates/default-form/default-form.component.ts +105 -0
  32. package/templates/angular-sdk-reference/src/components/templates/narrow-wide/narrow-wide.component.ts +37 -0
  33. package/templates/angular-sdk-reference/src/components/templates/one-column/one-column.component.ts +37 -0
  34. package/templates/angular-sdk-reference/src/components/templates/two-column/two-column.component.ts +37 -0
  35. package/templates/angular-sdk-reference/src/components/templates/wide-narrow/wide-narrow.component.ts +37 -0
  36. package/templates/angular-sdk-reference/tsconfig.app.json +13 -0
  37. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +75 -34
  38. package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +74 -38
  39. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +33 -1
  40. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +57 -22
  41. package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +25 -10
  42. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +40 -19
  43. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +62 -1
  44. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +26 -4
  45. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +84 -33
  46. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +46 -26
  47. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +28 -15
  48. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +24 -6
  49. package/templates/react-sdk-reference/.ai-common/prompts/generate-infra-components.md +24 -6
  50. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +24 -6
  51. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +24 -6
  52. package/templates/react-sdk-reference/.ai-common/prompts/identify-components.md +2 -0
  53. package/templates/react-sdk-reference/.ai-common/prompts/replace-design-system.md +44 -17
  54. package/templates/react-sdk-reference/.ai-common/skills/connect-pega-server.md +14 -1
  55. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AssignmentHeader.md +79 -0
  56. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Toast.md +96 -0
  57. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +56 -35
  58. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +29 -3
  59. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +97 -37
  60. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +91 -60
  61. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +88 -30
  62. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +133 -101
  63. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedData.md +385 -0
  64. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedDataMulti.md +506 -0
  65. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +549 -86
  66. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +181 -83
  67. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +13 -1
  68. package/templates/react-sdk-reference/.ai-common/skills/portal-flow/run-and-verify-portal.md +290 -0
  69. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +13 -1
  70. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +125 -153
  71. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +90 -81
  72. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +13 -1
  73. package/templates/react-sdk-reference/assets/icons/trash.svg +3 -0
  74. package/templates/react-sdk-reference/index.html +0 -1
  75. package/templates/react-sdk-reference/package.json +2 -2
  76. package/templates/react-sdk-reference/package.minimal.json +2 -2
  77. package/templates/react-sdk-reference/sdk-config.json +3 -3
  78. package/templates/react-sdk-reference/src/FallbackComponent.tsx +1 -1
  79. package/templates/react-sdk-reference/src/MashupApp.tsx +33 -78
  80. package/templates/react-sdk-reference/src/PortalApp.tsx +23 -100
  81. package/templates/react-sdk-reference/src/components/component-map.ts +15 -1
  82. package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/AssignmentHeader.tsx +15 -0
  83. package/templates/react-sdk-reference/src/components/designSystemExtension/AssignmentHeader/index.tsx +1 -0
  84. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +1 -1
  85. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +1 -1
  86. package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +16 -4
  87. package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/ModalDialog.tsx +26 -0
  88. package/templates/react-sdk-reference/src/components/designSystemExtension/ModalDialog/index.tsx +1 -0
  89. package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/Toast.tsx +35 -0
  90. package/templates/react-sdk-reference/src/components/designSystemExtension/Toast/index.tsx +1 -0
  91. package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +362 -24
  92. package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +1 -1
  93. package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +3 -1
  94. package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +6 -3
  95. package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +2 -1
  96. package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +2 -1
  97. package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +4 -3
  98. package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +2 -0
  99. package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +2 -1
  100. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/EmbeddedDataMulti.tsx +121 -0
  101. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/config-ext.json +7 -0
  102. package/templates/react-sdk-reference/src/components/field/EmbeddedDataMulti/index.tsx +1 -0
  103. package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +2 -1
  104. package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +1 -1
  105. package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +40 -20
  106. package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +554 -49
  107. package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -20
  108. package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +4 -3
  109. package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +2 -1
  110. package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +2 -1
  111. package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +2 -1
  112. package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +2 -1
  113. package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +2 -1
  114. package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +2 -1
  115. package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +1 -1
  116. package/templates/react-sdk-reference/src/components/helpers/field-utils.ts +44 -0
  117. package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +19 -7
  118. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/DataViewActionButtons.tsx +97 -0
  119. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/DataViewActionButtons/index.tsx +1 -0
  120. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +53 -0
  121. package/templates/react-sdk-reference/src/components/infra/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
  122. package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +2 -2
  123. package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +3 -1
  124. package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +4 -4
  125. package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +2 -2
  126. package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +1 -1
  127. package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +7 -3
  128. package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +173 -99
  129. package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +63 -56
  130. package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +1 -1
  131. package/templates/react-sdk-reference/vite.config.ts +26 -4
  132. package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +0 -47
  133. package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +0 -50
  134. package/templates/react-sdk-reference/.ai-common/instructions/infra-component.md +0 -76
  135. package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +0 -43
  136. package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +0 -45
  137. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +0 -311
  138. package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
  139. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
@@ -8,7 +8,7 @@ Prove that a wired case flow actually runs in the customer's application — by
8
8
 
9
9
  Wiring is not verification. A wired integration can compile cleanly and still fail at runtime: a missing registry key, an asset that does not resolve from the launching route, a rendering-boundary violation at the trigger. This skill closes that gap so the customer is not the one who discovers the failure.
10
10
 
11
- Use this after `{{SKILL_DIR}}/embedded-flow/wire-integration.md` has completed. It is the terminal step of the embedded flow.
11
+ Use this after `{{SKILL_DIR}}/embedded-flow/wire-integration{{SKILL_EXT}}` has completed. It is the terminal step of the embedded flow.
12
12
 
13
13
  ---
14
14
 
@@ -20,13 +20,20 @@ Use this after `{{SKILL_DIR}}/embedded-flow/wire-integration.md` has completed.
20
20
 
21
21
  **Never handle credentials.** A human authenticates in a visible browser window. Credentials are never requested, captured, logged, echoed, or written to any file by the agent, in any stage, under any failure condition.
22
22
 
23
+ **Tell the user where you are, in plain words.** Announce each stage as it starts, counting only the stages that run — "Trying it out — part 2 of 4: Opening your app". Use these names: Stage 1 "Checking the code", Stage 2 "Opening your app", Stage 3 "Signing in", Stage 4 "Testing the form", Stage 5 "Fixing what failed".
24
+
25
+ **You run every stage yourself, in this conversation.** Start right after wiring, without asking first. Open the browser, drive the application, check the results, and repair what fails. The human's only part is signing in, in the window you open. Never hand the sign-in or any later stage back to the user and end your turn, and never ask them to open the application in their own browser to try it.
26
+
27
+ **Never lighten a stage.** Do not replace a stage with a smaller or cheaper check because the run is long, the component count is large, or a stage needs a human for a moment. Stop early only for the reasons listed in [Stopping early](#stopping-early).
28
+
23
29
  ---
24
30
 
25
31
  ## Prerequisites
26
32
 
27
33
  - The integration is wired and the case-launch trigger is reachable from a route in the running application
28
34
  - `sdk-config.json` holds real values for the customer's Pega environment
29
- - A human is available to authenticate when the flow reaches the Pega login form
35
+ - The user is in the conversation to sign in when the login window you open asks for it
36
+ - The Design Profile exists — Stage 4 assertions 10 and 11 read its example forms, Global Appearance, and Form Layout Convention
30
37
 
31
38
  ---
32
39
 
@@ -36,10 +43,10 @@ No browser, no credentials. Run these first; they are the cheapest and catch the
36
43
 
37
44
  1. **Production build.** Resolve and run the project's production build. This matters more than a development build: development servers frequently tolerate rendering-boundary violations that the production build rejects, and a server-rendered route that fails only in production is invisible until deploy.
38
45
  2. **Type check.** Run the project's type-check entry point. If it has none, invoke the type checker the project already depends on in a no-emit mode using the project's own compiler configuration. Do not add a script entry for this.
39
- 3. **Lint.** Run the project's lint entry point over the generated component folder and every seam file wiring touched.
40
- 4. **Configuration coherence.** Read the served SDK configuration file and assert that the case type is set and that `portalClientId` is present and non-empty. An empty `portalClientId` makes the SDK classify the session as custom-auth and return without ever resolving its readiness promise — a permanent hang with no network activity, no error, and nothing in the console. It costs nothing to catch here and is close to undiagnosable three stages later.
46
+ 3. **Lint.** Run the project's lint entry point over the generated component folder and every seam file wiring touched. Fix every error in those files. If many still remain after one repair pass, list them grouped by rule and ask the user whether to keep fixing or to continue verification with them noted in the summary.
47
+ 4. **Configuration coherence.** Read the served SDK configuration file and assert that the case type is set and that both `mashupClientId` and `portalClientId` are present and non-empty. The embedded login popup reads the mashup identifier and a redirect login reads the portal one; an empty identifier for the active mode makes the SDK classify the session as custom-auth and return without ever resolving its readiness promise — a permanent hang with no network activity, no error, and nothing in the console. It costs nothing to catch here and is close to undiagnosable three stages later.
41
48
 
42
- All of these must pass before continuing. A failure here is almost always agent-owned code or configuration — fix it and re-run this stage.
49
+ All of these must pass before continuing, apart from lint errors the user chose to note rather than fix. A failure here is almost always agent-owned code or configuration — fix it and re-run this stage.
43
50
 
44
51
  ---
45
52
 
@@ -47,7 +54,14 @@ All of these must pass before continuing. A failure here is almost always agent-
47
54
 
48
55
  ### Choosing a browser driver
49
56
 
50
- Prefer a browser automation library already present in the customer's dependency manifest. Only when none exists, add one as a development dependency — this is a permitted seam. Ask before adding it if the project's dependency policy is unclear.
57
+ Use either of these, in this order of preference:
58
+
59
+ 1. A browser automation library already present in the customer's dependency manifest.
60
+ 2. Your AI tool's own browser control, if it has one that can show a window the human can sign in to, follow a login popup, and keep watching the page while they do.
61
+
62
+ Only when neither is available, add a browser automation library as a development dependency — this is a permitted seam. Ask before adding it if the project's dependency policy is unclear. Ask it in plain words — "I need a browser-testing tool to try the form. Can I add one to your project?" — and keep the term "dependency policy" out of the question. If the user declines, stop per [Stopping early](#stopping-early).
63
+
64
+ **If the login popup does not work in your tool's own browser** — activating the trigger opens no login window there, or the window opens where the human cannot sign in — that is a limit of the browser, not a wiring defect. Change nothing in the application because of it. Switch to a browser automation library (one already in the project, or one you add after asking as above), tell the user in plain words that you switched browsers and why, and re-run Stage 2 in it before continuing to Stage 3.
51
65
 
52
66
  ### Starting the application
53
67
 
@@ -55,15 +69,27 @@ Start the project's development server and **discover its address from the serve
55
69
 
56
70
  If the Pega server named in `sdk-config.json` is unreachable from this environment, stop here. Report that verification is limited to Stage 1, state which host could not be reached, and do not present the run as a failure of the integration.
57
71
 
72
+ ### Checking the Pega server accepts this application's address
73
+
74
+ Before anyone is asked to sign in, confirm the Pega server allows browser calls from this application. Send a CORS preflight — an `OPTIONS` request that carries no credentials — to the API path the SDK will call: `{infinityRestServerUrl}/app/{appAlias}/api/application/v2/data_views/D_pxBootstrapConfig` when `serverConfig.appAlias` is set, or `{infinityRestServerUrl}/api/application/v2/data_views/D_pxBootstrapConfig` when it is empty. Send it with the application's real origin, taken from the development server's startup output, as the `Origin` header, `GET` as the requested method, and `authorization,content-type` as the requested headers.
75
+
76
+ The check passes when the response carries `Access-Control-Allow-Origin` equal to that origin. This is an extra check, not a substitute for the browser checks below.
77
+
78
+ If the response has no such header, or names a different origin, stop before Stage 3 and report it as a server setting — see [What must only be reported](#what-must-only-be-reported). Do not change the application to work around it. If this environment cannot send the preflight at all, run the same check in the browser instead: after sign-in, watch the first Pega API call and treat a CORS error on it the same way.
79
+
80
+ When the user says the server setting is updated, run this check again and, once it passes, continue with Stage 2. Nothing needs to be regenerated or rewired.
81
+
58
82
  ### Checks
59
83
 
60
- Load the route hosting the case-launch trigger, then assert:
84
+ Load the route hosting the case-launch trigger **in the browser**, then assert the checks below. Fetching the route or the runtime files over plain HTTP is a useful quick pre-check, but it never satisfies this stage: only a real browser exercises rendering, the console, and the login popup.
85
+
86
+ Assert:
61
87
 
62
88
  1. The route renders — no server-render failure, no error overlay
63
89
  2. The browser console and page-error channels are clean; collect anything that appears
64
- 3. The Pega runtime global is present on the window object before application code needs it
65
- 4. The SDK configuration file and the core runtime script both resolve successfully **from the depth of this specific route**. A reference that works from the application root can still fail from a nested route, and this is the failure it exists to catch
66
- 5. Activating the trigger mounts the Pega container element
90
+ 3. The runtime global is **absent** before authentication. It is loaded only after login, so its absence here is expected; assert that nothing in the page's HTML or entry module references the core bundle
91
+ 4. The SDK configuration file resolves successfully **from the depth of this specific route**, and the runtime shell (`/constellation/bootstrap-shell.js`) and library manifest (`/constellation/lib_asset.json`) resolve as a script and as JSON, **not as the application's HTML**. A reference that works from the application root can still fail from a nested route, and a toolchain that falls back to the entry document answers a missing runtime file with HTML that looks like success — these are the failures this check exists to catch
92
+ 5. Activating the trigger starts authentication: a login popup opens, and the target surface shows its loading state rather than an error
67
93
 
68
94
  Stage 2 is the last point at which failures are cheap to diagnose. Do not skip ahead when a check here fails.
69
95
 
@@ -71,13 +97,17 @@ Stage 2 is the last point at which failures are cheap to diagnose. Do not skip a
71
97
 
72
98
  ## Stage 3 — Authentication handoff
73
99
 
74
- The SDK performs a full-page redirect to the Pega login form. This is expected and is not automated.
100
+ The SDK opens a separate login window. This is expected and is not automated.
75
101
 
76
102
  1. Run the browser in a mode the human can see and interact with
77
- 2. On navigation to the Pega origin, print a clear, unmissable instruction: sign in in the open browser window; verification resumes on its own afterwards
78
- 3. Wait for navigation back to the application's origin, with a timeout generous enough for a person to read a prompt, find credentials, and complete any second factor
103
+ 2. When the login window opens on the Pega origin, print a clear, unmissable instruction: sign in in the open login window; verification resumes on its own afterwards. For example: "Please sign in to Pega in the window that just opened. I'll carry on by myself once you're signed in."
104
+ 3. Wait for the login window to close and the application page to move past its loading state, with a timeout generous enough for a person to read a prompt, find credentials, and complete any second factor. Keep waiting in this same turn — do not end your turn and ask the user to come back. The application page itself is not navigated away or reloaded in this flow
79
105
  4. Persist the browser session state afterwards so later runs may skip this stage. Write it to a dedicated directory that holds nothing else — `.pega-verify/` at the project root — so a single ignore rule covers it
80
106
 
107
+ If the login window never opens, or closes immediately with an error state reporting a blocked popup, the login did not start from the user's launch action, or the callback assets are missing. Both are wiring defects — diagnose per Stage 5.
108
+
109
+ If the host was deliberately configured for main-window redirect login instead, the whole window navigates to the Pega login form and back. Run the same handoff, and wait for navigation back to the application's origin.
110
+
81
111
  Session-state reuse is **best-effort only**. Pega may hold tokens in storage that session snapshots do not capture, in which case this stage simply recurs — that is not a failure.
82
112
 
83
113
  ⚠️ **The saved file contains live session tokens.** Before writing it, add an ignore rule for that directory to the project's version-control ignore file, and confirm the rule is in place. Never commit the file, and never print its contents. Adding the ignore rule is a permitted seam.
@@ -93,12 +123,18 @@ With the case form rendered:
93
123
  3. **The assignment is rendering, not the case view.** The embedded flow launches an assignment. Case-level chrome means the wrong page was launched — assert there is no case stage indicator, no case-history or details tab strip, and no case summary panel. Step navigation _within_ the assignment is expected and is not case chrome
94
124
  4. **No fallback markers.** The fallback component renders the name of any component the runtime requested but could not resolve. Its presence anywhere in the rendered output is a registry gap, and the rendered text names exactly which component is missing. Assert there are none. Check assertion 3 first: components that only exist in the case view will surface here as fallback markers when the wrong page was launched, and adding registry entries for them treats the symptom
95
125
  5. **A field round-trips.** At least one generated field accepts input and retains its value after the commit event fires. This is what separates a component that renders from a component that is wired
96
- 6. **The flow is where it was launched from.** After the redirect completes, assert the case form is visible on the surface the user triggered it from — the overlay re-opened, or the location restored. Landing on the application's root with no flow visible is the failure this catches, and it is a wiring defect, not a Pega one
126
+ 6. **The flow is where it was launched from.** After authentication completes, assert the case form is visible on the surface the user triggered it from, and that the page was not reloaded during login. If redirect login is configured, assert instead that the overlay re-opened or the location was restored — landing on the application's root with no flow visible is the failure this catches, and it is a wiring defect, not a Pega one
97
127
  7. **The flow can be launched again.** Dismiss the flow, launch it a second time, and assert the form renders again with empty fields — then dismiss and launch a third time, to prove the second launch was not a one-off recovery. Assert that runtime bootstrap is **not** repeated: only the first launch may issue the bootstrap request, while every launch issues its own case-creation request. A second launch that hangs on a loading state with no request at all means the runtime was discarded with the target and cannot be re-established; a second launch that reveals an empty target, or one still showing the previous case's values, means case creation is bound to set-up rather than to the launch. **Do not stop at the first successful launch** — set-up and first launch coincide, so a single pass cannot see either failure
98
128
  8. **Console clean.** No errors during form render or interaction
99
129
  9. **Evidence on failure.** Capture a screenshot and the collected console output for any failed assertion
130
+ 10. **The form looks like the host.** Pick reference elements from the host's own UI — body text, a label, an input, and a primary button on one of the forms recorded in the Design Profile — and compare their computed styles with the same kinds of element inside the Pega form. Also capture a side-by-side screenshot of the host form and the Pega form for the human to judge.
131
+ - **Must match:** font family and base text colour. Generated components inherit both, so a difference is a defect — repair it per Stage 5 and re-check
132
+ - **Report only:** font sizes, accent colour, and corner radius. List each difference with both values next to the screenshot; hosts legitimately use several of each, so these are never forced
133
+ 11. **The layout holds.** Measure the visible fields inside the Pega form, and repeat the measurement in two more states: with validation errors showing (submit with a required field empty), and with the form's area narrowed below the stacking width recorded in the Design Profile.
134
+ - **Must hold:** no two visible fields overlap; nothing is wider than the form's area, so no horizontal scrolling appears inside it; fields in the same column share a left edge; when narrowed, multi-column layouts stack into one column. A failure is a defect — repair it per Stage 5 and re-check
135
+ - **Report only:** gaps between fields or columns that differ from the Form Layout Convention, with the measured and expected values
100
136
 
101
- ⚠️ **At least one full pass must start from a session with no prior authentication state.** Assertions 2 and 6 only exercise the redirect path on a first authentication; once a session exists the application is never torn down and both pass regardless of whether the launch context was ever persisted. A run that reuses saved session state is valid for everything else, but it cannot be the only run.
137
+ ⚠️ **At least one full pass must start from a session with no prior authentication state.** Only a first authentication exercises the login popup, the callback assets, and the hold-the-launch-until-ready behaviour; once a session exists, the runtime is already ready at the first launch and all of these pass regardless of whether they were wired correctly. If redirect login is configured, assertions 2 and 6 also exercise the restoration path only on a first authentication. A run that reuses saved session state is valid for everything else, but it cannot be the only run.
102
138
 
103
139
  ---
104
140
 
@@ -108,28 +144,51 @@ With the case form rendered:
108
144
 
109
145
  Only code the agent generated, or a declared integration seam.
110
146
 
111
- | Symptom | Cause | Fix |
112
- | ---------------------------------------------------------- | ----------------------------------------------------------- | --------------------------------------------------------------------- |
113
- | Case view renders instead of the assignment | The launch call omits the embedded page name | Correct the arguments to the case-creation call at the trigger seam |
114
- | Fallback component appears in the rendered output | The named component is absent from the registry | Add the registry entry, generating the component if it does not exist |
115
- | Type or lint failure in a generated component | Generated code does not satisfy the project's toolchain | Correct the generated file |
116
- | Configuration file or core runtime script fails to resolve | The reference is wrong for the launching route's depth | Correct the reference at the entry-point seam |
117
- | Pega runtime global undefined | Core runtime script missing, mis-ordered, or wrongly loaded | Correct the load order or strategy at the entry-point seam |
118
- | Container never mounts on trigger activation | Trigger not connected, or the host element is absent | Connect the trigger or add the host element |
119
- | Rendering-boundary error at the trigger | The trigger seam crosses a server/client boundary illegally | Restructure the trigger seam, and only the trigger seam |
120
- | Field value lost after the commit event | The actions-API call is missing or mis-sequenced | Correct the wiring inside the generated field |
147
+ | Symptom | Cause | Fix |
148
+ | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
149
+ | Case view renders instead of the assignment | The launch call omits the embedded page name | Correct the arguments to the case-creation call at the trigger seam |
150
+ | Fallback component appears in the rendered output | The named component is absent from the registry | Add the registry entry, generating the component if it does not exist |
151
+ | Type or lint failure in a generated component | Generated code does not satisfy the project's toolchain | Correct the generated file |
152
+ | Configuration file or runtime files fail to resolve | The configuration reference is wrong for the launching route's depth, or the `/constellation/` runtime files are not served | Correct the reference or the static-serving rule at the entry-point seam |
153
+ | Pega runtime global undefined after login | The runtime files are not served, or login never completed | Serve the runtime files per the wiring skill; confirm login finished |
154
+ | Login window blocked, or closes with an error state | Login did not start from the launch action, or the callback assets are missing | Start the runtime from the trigger itself, or place the callback assets at the entry-point seam |
155
+ | Container never mounts on trigger activation | Trigger not connected, or the host element is absent | Connect the trigger or add the host element |
156
+ | Rendering-boundary error at the trigger | The trigger seam crosses a server/client boundary illegally | Restructure the trigger seam, and only the trigger seam |
157
+ | Field value lost after the commit event | The actions-API call is missing or mis-sequenced | Correct the wiring inside the generated field |
158
+ | Pega form uses a different font family or base text colour from the host | A generated component sets its own font or colour, or the Pega container sits outside the host's theme scope | Remove the override from the generated component, or bring the container into the host's scope at the host-element seam |
159
+ | Fields overlap, overflow the form, or are misaligned | A generated field adds its own margins, fixed sizes, or positioning, or a layout template aligns or stacks incorrectly | Correct the generated field or layout template per the Form Layout rules |
121
160
 
122
161
  ### What must only be reported
123
162
 
124
163
  **Never fix these. Stop and hand back.**
125
164
 
126
165
  - Anything requiring credentials or a reachable environment — server URL, application alias, client identifier, an empty portal client identifier, a case type that does not exist, authorization refused. These belong to the customer
166
+ - **A Pega CORS policy that does not allow this application's address.** The browser shows a CORS error on a Pega API call, or the preflight check in Stage 2 fails, and the application stays on its loading state. Never change application code for it. Report the blocked URL and the application's origin, and tell the user how their Pega administrator fixes it:
167
+ - In Pega, open **Endpoint-CORS policy mapping** and find the **most specific** endpoint that matches the blocked path — for example `app/<Alias>` takes precedence over `*`, so an allow-all `*` row does not help when a more specific row exists
168
+ - Open the CORS policy mapped to that endpoint and add the origin under **Allowed origins**
169
+ - The OAuth client registration's redirect URIs do not control this
170
+ - The browser may keep the old answer for the policy's **Maximum age**, so after the change use a hard refresh, a new private window, or wait that long
171
+
172
+ Say it in plain words, for example: "Your Pega server doesn't yet allow your app's address (`http://localhost:3000`) to talk to it. Ask your Pega administrator to add it under Allowed origins in the CORS policy for the `app/MediaCo` endpoint. Tell me when it's done and I'll carry on testing."
173
+
127
174
  - **Any defect in customer code outside the declared seams.** A failing assertion is not permission to edit the customer's application until it passes. Report the file, the symptom, and the likely cause, and stop
128
- - Anything visual. This skill verifies that the flow renders and functions, never that it looks correct
175
+ - Anything visual beyond the must-match and must-hold checks of Stage 4 assertions 10 and 11. Those checks are the only visual repairs this skill makes; everything else about how the form looks is reported, never forced
129
176
 
130
177
  ### The loop
131
178
 
132
- Fix, re-run the stage that failed, continue. Cap the number of repair cycles. On exhausting the cap, or on reaching any report-only class, hand back with the captured evidence and a specific diagnosis rather than continuing to try variations.
179
+ Fix, re-run the stage that failed, continue. Cap the number of repair cycles at three attempts per failing check. On exhausting the cap, or on reaching any report-only class, hand back with the captured evidence and a specific diagnosis rather than continuing to try variations.
180
+
181
+ ### Stopping early
182
+
183
+ Stop before Stage 4 has run only for one of these reasons, and always finish with the verification summary:
184
+
185
+ - The Pega server is unreachable from this environment (Stage 2)
186
+ - The Pega server does not allow this application's address — its CORS policy rejects the application's origin (Stage 2 preflight, or a CORS error after sign-in)
187
+ - No browser can be used: the tool's own browser cannot follow the login popup and the user declined adding a browser automation library
188
+ - The sign-in was not completed before the Stage 3 timeout
189
+ - A report-only failure was reached, or the repair cap was exhausted
190
+
191
+ Anything else — the run being long, many components, a stage needing a human for a moment — is not a reason to stop.
133
192
 
134
193
  ---
135
194
 
@@ -137,20 +196,21 @@ Fix, re-run the stage that failed, continue. Cap the number of repair cycles. On
137
196
 
138
197
  Always finish by reporting, whatever the outcome:
139
198
 
140
- - Which stages ran and which passed
199
+ - Which stages ran and which passed — mark each stage **passed**, **fixed**, or **not run**, with the reason for any stage not run
141
200
  - Every fix applied, with the file and the reason
142
201
  - Everything that needs the customer, stated as a concrete action
143
- - The furthest stage reached, so "done" is never ambiguous between _generated_ and _verified_
202
+ - The furthest stage reached, so "done" is never ambiguous between _generated_ and _verified_. If Stage 3 or Stage 4 did not run, say plainly "**Not verified yet**", give the reason from [Stopping early](#stopping-early), and say what the user can do next
144
203
 
145
204
  ---
146
205
 
147
206
  ## Common failures specific to embedded flows
148
207
 
149
- | Symptom | Cause |
150
- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
151
- | Route renders in development but fails the production build | A server-rendered component passes a non-serializable value into a client boundary at the trigger seam |
152
- | Configuration or runtime script returns not-found | The reference is relative and the launching route sits deeper than the application root |
153
- | Initialization never completes, with no error | The portal client identifier is empty, so the session is classified as custom authentication and the initializer's promise never settles |
154
- | Case stage indicator, case-history tabs, or a case summary appear | The case-creation call omits the embedded page name, so the runtime returns the whole case view instead of the assignment |
155
- | A component renders as its own name in plain text | The fallback component is standing in for a missing registry key |
156
- | Case form renders but values reset | The generated field holds local state without committing through the actions API |
208
+ | Symptom | Cause |
209
+ | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
210
+ | Route renders in development but fails the production build | A server-rendered component passes a non-serializable value into a client boundary at the trigger seam |
211
+ | Configuration or runtime files return not-found, or HTML | The configuration reference is relative and the launching route sits deeper than the application root, or the runtime files are not served at their absolute `/constellation/` URLs |
212
+ | Initialization never completes, with no error | The client identifier for the active login mode is empty, so the session is classified as custom authentication and the initializer's promise never settles |
213
+ | Case stage indicator, case-history tabs, or a case summary appear | The case-creation call omits the embedded page name, so the runtime returns the whole case view instead of the assignment |
214
+ | A component renders as its own name in plain text | The fallback component is standing in for a missing registry key |
215
+ | Case form renders but values reset | The generated field holds local state without committing through the actions API |
216
+ | Stuck on the loading state after sign-in, with a CORS error on a Pega API call | The Pega CORS policy for the most specific matching endpoint does not list the application's origin. Setting `appAlias` sends calls to `/app/<Alias>/api/...`, which can be mapped to a stricter policy than `/api/...`. A server setting — report it, never patch the application |