@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
package/README.md CHANGED
@@ -8,12 +8,21 @@ building right away.
8
8
  ## For AI Coding Agents
9
9
 
10
10
  Recognize these as requests to run this CLI, whether the folder is empty or already
11
- has a project in it:
12
-
13
- - "Scaffold a new Pega app / project using `@pega/sdk`" → run in an **empty folder**.
14
- - "Scaffold `@pega/sdk` / add Pega embedded flow into this repo" (or similar,
15
- said while working inside an existing host application) → run in that
16
- **existing project's folder**.
11
+ has a project in it. Users rarely use these words — judge by what they want, not
12
+ by how they say it:
13
+
14
+ - **They want a Pega form or workflow inside the app they already have** → run in
15
+ that **existing project's folder**. For example: "Scaffold `@pega/sdk` / add Pega
16
+ embedded flow into this repo", "add the service request form to my app when
17
+ someone clicks Apply", "show a Pega form inside my page", "let customers raise a
18
+ case from our website".
19
+ - **They want a new Pega app or portal** → run in an **empty folder**. For example:
20
+ "Scaffold a new Pega app / project using `@pega/sdk`", "start a new Pega app with
21
+ Chakra UI", "build me a Pega portal".
22
+
23
+ The examples are illustrations, not a complete list. Ask the user only when the
24
+ request is genuinely unclear — for example, they say "my app" but the folder is
25
+ empty.
17
26
 
18
27
  In both cases, run `npx --yes @pega/sdk init` non-interactively — see
19
28
  [Non-Interactive / Scripted Usage](#non-interactive--scripted-usage) below for the
@@ -36,6 +45,12 @@ about or guess:
36
45
  | `--mode` (auto-detected from whether `package.json` exists in the cwd) | none — these are all optional and not needed to scaffold |
37
46
  | `--ai-tool` (set it to yourself: GitHub Copilot → `copilot`, Cursor → `cursor`, Claude Code → `claude-code`) | |
38
47
  | `--framework`, `--name`, `--templates`, `--categories` (infer from the request, or ask only if genuinely ambiguous) | |
48
+ | `--conflict-policy` (embedded mode only — see below) | |
49
+
50
+ `--conflict-policy` applies only in embedded mode and is ignored in new-project
51
+ mode. Leave it at `merge` (the default): it keeps the host's existing files, adds
52
+ Pega content inside marked blocks, and fills in missing JSON keys. Pass `override`
53
+ only when the user explicitly asks to replace their existing files.
39
54
 
40
55
  Server connection details (Pega server URL, app alias, OAuth client ID, MCP rule
41
56
  name/instance key) are never asked at scaffold time, in either mode — the scaffold
@@ -44,6 +59,31 @@ placeholder markers. An AI coding assistant gathers these from the user in chat
44
59
  and fills both files in automatically the first time a workflow needs them (see
45
60
  [Configure Your Pega Server](#configure-your-pega-server)).
46
61
 
62
+ ### After the command finishes
63
+
64
+ When `--ai-tool` is set, the CLI prints the project folder, the agent to continue
65
+ with, and its files. Files written during your current turn are not in your context
66
+ yet, so do not carry on from memory:
67
+
68
+ | Mode | Agent | Continue when |
69
+ | ----------- | ------------------------- | -------------------------------------------------------------------------------------------------------------- |
70
+ | Embedded | **Embedded Flow Expert** | Always |
71
+ | New project | **Implementation Expert** | Only when the user asked for more than a new project (e.g. "…with Chakra UI"); otherwise give plain next steps |
72
+
73
+ | AI tool | Project instructions | Agent file | What to do |
74
+ | ----------- | --------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
75
+ | Copilot | `.github/copilot-instructions.md` | `.github/agents/<agent>.agent.md` | Stop. Tell the user to choose the agent in the agent menu and say "continue" |
76
+ | Cursor | `.cursor/rules/pega-sdk.mdrules` | `.cursor/rules/agents/<agent>.mdrules` | Stop. Tell the user to `@`-mention the agent (e.g. `@embedded-flow-expert`) in chat |
77
+ | Claude Code | `AGENTS.md` | `.claude/agents/<agent>.md` | Read both files, then continue the user's original request in this chat. Suggest a new session for later requests, so the project instructions load from the start |
78
+
79
+ - **Say it in plain words**, for example: "Setup is done. To continue, choose
80
+ **Embedded Flow Expert** in the agent menu and say 'continue'." For Copilot and
81
+ Cursor, repeat the user's original request so they can paste it.
82
+ - **New project:** the AI tools find these files only at the top of the open
83
+ folder, so the user must open the printed project folder first, in every tool.
84
+ - **No agent printed** (a framework without AI files, or `--ai-tool none`): give
85
+ plain next steps only.
86
+
47
87
  ## Requirements
48
88
 
49
89
  - **Node.js** 20 or later
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@
4
4
  import * as p from "@clack/prompts";
5
5
  import pc from "picocolors";
6
6
  import path4 from "path";
7
+ import fs4 from "fs";
7
8
  import { createRequire } from "module";
8
9
 
9
10
  // src/scaffold.ts
@@ -206,6 +207,10 @@ var DSE_COMPONENTS = [
206
207
  importName: "AlertBanner",
207
208
  importPath: "./designSystemExtension/AlertBanner"
208
209
  },
210
+ {
211
+ importName: "AssignmentHeader",
212
+ importPath: "./designSystemExtension/AssignmentHeader"
213
+ },
209
214
  { importName: "Banner", importPath: "./designSystemExtension/Banner" },
210
215
  {
211
216
  importName: "CaseSummaryFields",
@@ -233,6 +238,7 @@ var DSE_COMPONENTS = [
233
238
  importName: "RichTextEditor",
234
239
  importPath: "./designSystemExtension/RichTextEditor"
235
240
  },
241
+ { importName: "Toast", importPath: "./designSystemExtension/Toast" },
236
242
  {
237
243
  importName: "WssQuickCreate",
238
244
  importPath: "./designSystemExtension/WssQuickCreate"
@@ -762,6 +768,15 @@ var AI_GEN_CONFIGS = {
762
768
  }
763
769
  }
764
770
  };
771
+ var GLOBAL_INSTRUCTIONS_PATHS = {
772
+ copilot: ".github/copilot-instructions.md",
773
+ cursor: ".cursor/rules/pega-sdk.mdrules",
774
+ "claude-code": "AGENTS.md"
775
+ };
776
+ function aiAgentFiles(aiTool, agent) {
777
+ const cfg = AI_GEN_CONFIGS[aiTool];
778
+ return { agentFile: `${cfg.agentsDir}/${agent}.${cfg.agentExt}`, globalFile: GLOBAL_INSTRUCTIONS_PATHS[aiTool] };
779
+ }
765
780
  function parseAiMeta(content) {
766
781
  const match = content.match(/^---\n([\s\S]*?)\n---\n\n?/);
767
782
  if (!match) return { meta: {}, body: content };
@@ -954,21 +969,21 @@ description: "${description}"
954
969
  const body = applyTokens(fs2.readFileSync(globalSrc, "utf-8"), tokens);
955
970
  if (aiTool === "copilot") {
956
971
  planned.push({
957
- destPath: path2.join(targetDir, ".github", "copilot-instructions.md"),
972
+ destPath: path2.join(targetDir, GLOBAL_INSTRUCTIONS_PATHS.copilot),
958
973
  frontmatter: "",
959
974
  body,
960
975
  kind: "md"
961
976
  });
962
977
  } else if (aiTool === "cursor") {
963
978
  planned.push({
964
- destPath: path2.join(targetDir, ".cursor", "rules", "pega-sdk.mdrules"),
979
+ destPath: path2.join(targetDir, GLOBAL_INSTRUCTIONS_PATHS.cursor),
965
980
  frontmatter: "---\ndescription: Core rules for working with Pega SDK components\nalwaysApply: true\n---\n\n",
966
981
  body,
967
982
  kind: "md"
968
983
  });
969
984
  } else if (aiTool === "claude-code") {
970
985
  planned.push({
971
- destPath: path2.join(targetDir, "AGENTS.md"),
986
+ destPath: path2.join(targetDir, GLOBAL_INSTRUCTIONS_PATHS["claude-code"]),
972
987
  frontmatter: "",
973
988
  body,
974
989
  kind: "md"
@@ -1122,32 +1137,23 @@ async function scaffoldEmbedded(choices, targetDir, onProgress) {
1122
1137
  `Wrote ${planned.length} file(s): ${counts.created} new, ${counts["block-replaced"]} updated, ${counts.appended} merged, ${counts.overwritten} replaced.`
1123
1138
  );
1124
1139
  report("Copying SDK packages\u2026");
1125
- const tgzFiles = fs2.readdirSync(sampleDir).filter((f) => f.endsWith(".tgz"));
1126
- for (const tgz of tgzFiles) {
1127
- const src = path2.join(sampleDir, tgz);
1128
- const dest = path2.join(targetDir, tgz);
1129
- fs2.copyFileSync(src, dest);
1140
+ const samplePkgJson = JSON.parse(fs2.readFileSync(path2.join(sampleDir, "package.json"), "utf-8"));
1141
+ const pegaDependencies = {};
1142
+ for (const pkgName of ["@pega/auth", "@pega/constellationjs", "@pega/sdk-react", "@pega/sdk-types"]) {
1143
+ const spec = samplePkgJson.dependencies?.[pkgName];
1144
+ if (!spec) continue;
1145
+ pegaDependencies[pkgName] = spec;
1146
+ if (spec.startsWith("file:")) {
1147
+ const tgz = spec.slice("file:".length);
1148
+ fs2.copyFileSync(path2.join(sampleDir, tgz), path2.join(targetDir, tgz));
1149
+ }
1130
1150
  }
1131
1151
  report("Adding SDK dependencies\u2026");
1132
1152
  const pkgJsonPath = path2.join(targetDir, "package.json");
1133
1153
  if (fs2.existsSync(pkgJsonPath)) {
1134
1154
  const pkgJson = JSON.parse(fs2.readFileSync(pkgJsonPath, "utf-8"));
1135
1155
  if (!pkgJson.dependencies) pkgJson.dependencies = {};
1136
- const TGZ_PACKAGE_MAP = {
1137
- "pega-auth": "@pega/auth",
1138
- "pega-constellationjs": "@pega/constellationjs",
1139
- "pega-sdk-react": "@pega/sdk-react",
1140
- "pega-sdk-types": "@pega/sdk-types"
1141
- };
1142
- for (const tgz of tgzFiles) {
1143
- const match = tgz.match(/^(pega-[\w-]+?)-\d/);
1144
- if (match) {
1145
- const pkgName = TGZ_PACKAGE_MAP[match[1]];
1146
- if (pkgName) {
1147
- pkgJson.dependencies[pkgName] = `file:${tgz}`;
1148
- }
1149
- }
1150
- }
1156
+ Object.assign(pkgJson.dependencies, pegaDependencies);
1151
1157
  fs2.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + "\n");
1152
1158
  }
1153
1159
  report("Creating SDK configuration\u2026");
@@ -1254,7 +1260,17 @@ do not need to pass --mode.
1254
1260
  about. GitHub Copilot -> copilot, Cursor -> cursor, Claude Code -> claude-code.
1255
1261
  Always pass it: it decides which agent config files get written, and a repo can
1256
1262
  contain another assistant's config left behind by someone else.
1257
- `.trim();
1263
+
1264
+ Users often ask in plain words ("add the service request form to my app when
1265
+ someone clicks Apply", "start a new Pega app") \u2014 judge by intent, not wording.
1266
+
1267
+ When it finishes, the CLI prints the agent to continue with and its files.
1268
+ Copilot / Cursor: stop. Tell the user, in plain words, to switch to that agent
1269
+ (Copilot: pick it in the agent menu; Cursor: @-mention it in chat), then
1270
+ repeat their original request so they can paste it.
1271
+ Claude Code: read the printed instructions and agent files, then continue the
1272
+ user's original request in this chat.
1273
+ New project: the user must open the printed project folder first.`.trim();
1258
1274
  var HELP_TEXT = `
1259
1275
  Usage: npx --yes @pega/sdk init [flags]
1260
1276
 
@@ -1423,6 +1439,14 @@ function resolveNonInteractiveEmbeddedChoices(args, cwd) {
1423
1439
  // src/index.ts
1424
1440
  var require2 = createRequire(import.meta.url);
1425
1441
  var { version: sdkVersion } = require2("../package.json");
1442
+ function printAgentFiles(projectDir, aiTool, agent, agentName) {
1443
+ if (!aiTool) return;
1444
+ const { agentFile, globalFile } = aiAgentFiles(aiTool, agent);
1445
+ if (!fs4.existsSync(path4.join(projectDir, agentFile)) || !fs4.existsSync(path4.join(projectDir, globalFile))) return;
1446
+ console.log(`Project folder: ${projectDir}`);
1447
+ console.log(`Agent: ${agentName} \u2014 ${agentFile}`);
1448
+ console.log(`Project instructions: ${globalFile}`);
1449
+ }
1426
1450
  async function runNonInteractive(cwd, flags) {
1427
1451
  try {
1428
1452
  const mode = flags.mode ?? (detectExistingProject(cwd) ? "embedded" : "new");
@@ -1438,11 +1462,13 @@ async function runNonInteractive(cwd, flags) {
1438
1462
  }
1439
1463
  await scaffoldEmbedded(choices, cwd, (message) => console.log(pc.dim(message)));
1440
1464
  console.log(pc.green("Embedded flow ready!"));
1465
+ printAgentFiles(cwd, choices.aiTool, "embedded-flow-expert", "Embedded Flow Expert");
1441
1466
  } else {
1442
1467
  const choices = resolveNonInteractiveUserChoices(flags);
1443
1468
  const targetDir = path4.resolve(cwd, choices.projectName);
1444
1469
  await scaffold(choices, targetDir, (message) => console.log(pc.dim(message)));
1445
1470
  console.log(pc.green("Project scaffolded successfully!"));
1471
+ printAgentFiles(targetDir, choices.aiTool, "implementation-expert", "Implementation Expert");
1446
1472
  }
1447
1473
  } catch (err) {
1448
1474
  console.error(pc.red(err instanceof CliValidationError || err instanceof Error ? err.message : String(err)));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pega/sdk",
3
- "version": "0.0.13",
4
- "description": "Scaffold a Pega SDK application project",
3
+ "version": "0.0.15",
4
+ "description": "CLI to scaffold Pega SDK apps (React, Angular, Web Components) or embed Pega cases and forms into an existing app, with design-matched components and AI agent setup for Copilot, Cursor, and Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "sdk": "./dist/index.js"
@@ -39,7 +39,46 @@
39
39
  "sdk",
40
40
  "scaffold",
41
41
  "cli",
42
- "create-app"
42
+ "create-app",
43
+ "embed",
44
+ "embedded",
45
+ "mashup",
46
+ "constellation",
47
+ "pega-infinity",
48
+ "case",
49
+ "form",
50
+ "forms",
51
+ "workflow",
52
+ "ui",
53
+ "components",
54
+ "design-system",
55
+ "pega-sdk",
56
+ "pega-constellation",
57
+ "constellation-sdk",
58
+ "pega-mashup",
59
+ "pega-react-sdk",
60
+ "pega-angular-sdk",
61
+ "web-embed",
62
+ "embed-form",
63
+ "embed-case",
64
+ "case-management",
65
+ "workflow-automation",
66
+ "low-code",
67
+ "react",
68
+ "angular",
69
+ "web-components",
70
+ "react-native",
71
+ "typescript",
72
+ "vite",
73
+ "starter",
74
+ "boilerplate",
75
+ "template",
76
+ "ai-agent",
77
+ "copilot",
78
+ "cursor",
79
+ "claude-code",
80
+ "mcp",
81
+ "oauth"
43
82
  ],
44
83
  "license": "Apache-2.0"
45
84
  }
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ const CopyWebpackPlugin = require('copy-webpack-plugin');
4
+
5
+ // comment this code out, if you have an "ENOENT: no such file or directory" build error and re-build
6
+ // to see the real Angular errors, then uncomment onces fixed
7
+ module.exports = (config) => {
8
+ config.plugins.push(
9
+ new CopyWebpackPlugin({
10
+ patterns: [
11
+ {
12
+ from: '../../node_modules/@pega/auth/lib/oauth-client/authDone.html',
13
+ to: './auth.html',
14
+ },
15
+ {
16
+ from: '../../node_modules/@pega/auth/lib/oauth-client/authDone.js',
17
+ to: './',
18
+ },
19
+ ],
20
+ }),
21
+ );
22
+ return config;
23
+ };
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Pega SDK Angular Reference</title>
6
+ <base href="/" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ </head>
9
+ <body>
10
+ <app-root></app-root>
11
+ </body>
12
+ </html>
@@ -0,0 +1,153 @@
1
+ /**
2
+ * PConnectRendererComponent — Recursive Angular component that renders
3
+ * the PConnect c11nEnv tree as a visual fallback display.
4
+ *
5
+ * This is the Angular equivalent of React's PConnectComponent + FallbackComponent.
6
+ * It uses PConnectObservable from sdk-core to subscribe to state changes
7
+ * and recursively renders the component tree.
8
+ */
9
+
10
+ import {
11
+ Component,
12
+ Input,
13
+ OnInit,
14
+ OnDestroy,
15
+ NgZone,
16
+ ChangeDetectorRef,
17
+ } from '@angular/core';
18
+ import { CommonModule } from '@angular/common';
19
+ import { PegaBridgeService } from '@pega/sdk-angular';
20
+ import type { PConnectState, Unsubscribe } from '@pega/sdk-angular';
21
+
22
+ @Component({
23
+ selector: 'app-pconnect-renderer',
24
+ standalone: true,
25
+ imports: [CommonModule],
26
+ template: `
27
+ <div class="node">
28
+ <div class="node-header">{{ componentName }}</div>
29
+
30
+ <pre *ngIf="displayPropsJson" class="node-props">{{
31
+ displayPropsJson
32
+ }}</pre>
33
+
34
+ <!-- Recursively render children -->
35
+ <div *ngIf="childEnvs.length > 0" class="node-children">
36
+ <app-pconnect-renderer
37
+ *ngFor="let child of childEnvs; trackBy: trackByIndex"
38
+ [pConnect]="child"
39
+ ></app-pconnect-renderer>
40
+ </div>
41
+ </div>
42
+ `,
43
+ styles: [
44
+ `
45
+ .node {
46
+ border: 1px solid #ddd;
47
+ border-radius: 4px;
48
+ margin: 4px;
49
+ padding: 8px;
50
+ font-size: 13px;
51
+ font-family: system-ui, sans-serif;
52
+ }
53
+ .node-header {
54
+ background: #f0f4ff;
55
+ padding: 4px 8px;
56
+ border-radius: 3px;
57
+ font-size: 12px;
58
+ font-weight: 600;
59
+ color: #1a56db;
60
+ margin-bottom: 4px;
61
+ }
62
+ .node-props {
63
+ font-size: 11px;
64
+ color: #555;
65
+ margin: 4px 0;
66
+ max-height: 100px;
67
+ overflow: auto;
68
+ background: #fafafa;
69
+ padding: 4px;
70
+ border-radius: 3px;
71
+ white-space: pre-wrap;
72
+ }
73
+ .node-children {
74
+ padding-left: 12px;
75
+ }
76
+ `,
77
+ ],
78
+ })
79
+ export class PConnectRendererComponent implements OnInit, OnDestroy {
80
+ @Input() pConnect!: typeof PConnect;
81
+
82
+ componentName = 'Unknown';
83
+ displayPropsJson = '';
84
+ childEnvs: Array<typeof PConnect> = [];
85
+
86
+ private bridge = new PegaBridgeService();
87
+ private unsubscribe: Unsubscribe | null = null;
88
+
89
+ constructor(
90
+ private ngZone: NgZone,
91
+ private cdr: ChangeDetectorRef,
92
+ ) {}
93
+
94
+ ngOnInit(): void {
95
+ if (!this.pConnect) return;
96
+
97
+ // Resolve component name
98
+ const pc = this.pConnect as any;
99
+ this.componentName =
100
+ pc.getComponentName?.() ?? pc.componentName ?? 'Unknown';
101
+
102
+ // Create observable for state changes
103
+ const subscription = this.bridge.observe(this.pConnect).subscribe((state: PConnectState) => {
104
+ this.ngZone.run(() => {
105
+ this.applyState(state);
106
+ this.cdr.markForCheck();
107
+ });
108
+ });
109
+ this.unsubscribe = () => subscription.unsubscribe();
110
+
111
+ // Resolve children
112
+ this.resolveChildren();
113
+ }
114
+
115
+ ngOnDestroy(): void {
116
+ this.unsubscribe?.();
117
+ }
118
+
119
+ trackByIndex(index: number): number {
120
+ return index;
121
+ }
122
+
123
+ private applyState(state: PConnectState): void {
124
+ // Filter out function props and internal props for display
125
+ const displayProps = Object.fromEntries(
126
+ Object.entries(state.configProps).filter(
127
+ ([key, value]) =>
128
+ typeof value !== 'function' &&
129
+ !['getPConnect', 'pConnect', 'visibility'].includes(key),
130
+ ),
131
+ );
132
+ const json = JSON.stringify(displayProps, null, 2);
133
+ this.displayPropsJson = json !== '{}' ? json : '';
134
+ }
135
+
136
+ private resolveChildren(): void {
137
+ const pc = this.pConnect as any;
138
+ if (!pc.hasChildren?.()) {
139
+ this.childEnvs = [];
140
+ return;
141
+ }
142
+
143
+ const children = pc.getChildren?.() as any[];
144
+ if (!children) {
145
+ this.childEnvs = [];
146
+ return;
147
+ }
148
+
149
+ this.childEnvs = children.map((childEnv: any) => {
150
+ return childEnv.getPConnect ? childEnv.getPConnect() : childEnv;
151
+ });
152
+ }
153
+ }
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Angular sample component map — maps Pega component names to Angular component classes.
3
+ *
4
+ * Mirrors the getSampleComponentMap() pattern from @pega/sdk-react.
5
+ */
6
+
7
+ import type { Type } from '@angular/core';
8
+ import { registerAngularComponentMap } from '@pega/sdk-angular';
9
+
10
+ // Infrastructure
11
+ import { RootContainerComponent } from './infra/root-container/root-container.component';
12
+ import { ViewContainerComponent } from './infra/view-container/view-container.component';
13
+ import { FlowContainerComponent } from './infra/flow-container/flow-container.component';
14
+ import { AssignmentComponent } from './infra/assignment/assignment.component';
15
+ import { ViewComponent } from './infra/view/view.component';
16
+ import { ReferenceComponent } from './infra/reference/reference.component';
17
+ import { RegionComponent } from './infra/region/region.component';
18
+ import { CaseViewComponent } from './infra/case-view/case-view.component';
19
+ import { CaseSummaryComponent } from './infra/case-summary/case-summary.component';
20
+ import { StagesComponent } from './infra/stages/stages.component';
21
+
22
+ // Templates
23
+ import { DefaultFormComponent } from './templates/default-form/default-form.component';
24
+ import { OneColumnComponent } from './templates/one-column/one-column.component';
25
+ import { TwoColumnComponent } from './templates/two-column/two-column.component';
26
+ import { NarrowWideComponent } from './templates/narrow-wide/narrow-wide.component';
27
+ import { WideNarrowComponent } from './templates/wide-narrow/wide-narrow.component';
28
+
29
+ // Fields
30
+ import { TextInputComponent } from './fields/text-input/text-input.component';
31
+ import { TextAreaComponent } from './fields/text-area/text-area.component';
32
+ import { DropdownComponent } from './fields/dropdown/dropdown.component';
33
+ import { CheckboxComponent } from './fields/checkbox/checkbox.component';
34
+ import { RadioButtonsComponent } from './fields/radio-buttons/radio-buttons.component';
35
+ import { CurrencyComponent } from './fields/currency/currency.component';
36
+ import { DateInputComponent } from './fields/date-input/date-input.component';
37
+ import { EmailComponent } from './fields/email/email.component';
38
+ import { PhoneComponent } from './fields/phone/phone.component';
39
+ import { IntegerComponent } from './fields/integer/integer.component';
40
+ import { URLInputComponent } from './fields/url-input/url-input.component';
41
+ import { AutoCompleteComponent } from './fields/auto-complete/auto-complete.component';
42
+
43
+ function getSampleAngularComponentMap(): Record<string, Type<unknown>> {
44
+ return {
45
+ // Fields
46
+ TextInput: TextInputComponent,
47
+ TextArea: TextAreaComponent,
48
+ Dropdown: DropdownComponent,
49
+ Checkbox: CheckboxComponent,
50
+ RadioButtons: RadioButtonsComponent,
51
+ Currency: CurrencyComponent,
52
+ Date: DateInputComponent,
53
+ Email: EmailComponent,
54
+ Phone: PhoneComponent,
55
+ Integer: IntegerComponent,
56
+ URL: URLInputComponent,
57
+ AutoComplete: AutoCompleteComponent,
58
+
59
+ // Templates
60
+ DefaultForm: DefaultFormComponent,
61
+ OneColumn: OneColumnComponent,
62
+ TwoColumn: TwoColumnComponent,
63
+ NarrowWide: NarrowWideComponent,
64
+ WideNarrow: WideNarrowComponent,
65
+
66
+ // Infrastructure
67
+ Assignment: AssignmentComponent,
68
+ RootContainer: RootContainerComponent,
69
+ ViewContainer: ViewContainerComponent,
70
+ FlowContainer: FlowContainerComponent,
71
+ View: ViewComponent,
72
+ Region: RegionComponent,
73
+ CaseView: CaseViewComponent,
74
+ CaseSummary: CaseSummaryComponent,
75
+ Stages: StagesComponent,
76
+
77
+ // Aliases — PCore may use different name variants
78
+ AppShell: RootContainerComponent,
79
+ CaseViewContainer: ViewContainerComponent,
80
+ SubTabs: ViewContainerComponent,
81
+ DeferLoad: ViewContainerComponent,
82
+ reference: ReferenceComponent,
83
+ };
84
+ }
85
+
86
+ function registerSampleAngularComponents(): void {
87
+ registerAngularComponentMap(getSampleAngularComponentMap());
88
+ }
89
+
90
+ export { getSampleAngularComponentMap, registerSampleAngularComponents };