@pega/sdk 0.0.9 → 0.0.10
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/package.json +1 -1
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +4 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +1 -1
- package/templates/react-sdk-reference/.ai-common/mcp/cursor.mcp.json +1 -1
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +5 -0
- package/templates/react-sdk-reference/.ai-common/skills/connect-pega-server.md +54 -0
package/package.json
CHANGED
|
@@ -53,6 +53,10 @@ Determine which workflow governs the request, then execute it by reading the ref
|
|
|
53
53
|
|
|
54
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
55
|
|
|
56
|
+
### Step 0.0 — Ensure the Pega server connection is configured
|
|
57
|
+
|
|
58
|
+
Before executing any data source below, read and execute `{{SKILL_DIR}}/connect-pega-server.md`. It is a no-op when the connection is already configured, and otherwise gathers the missing values from the user and writes them into the MCP config and `sdk-config.json` before this step continues.
|
|
59
|
+
|
|
56
60
|
### Step 0.1 — Check for a case type in the prompt
|
|
57
61
|
|
|
58
62
|
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.
|
|
@@ -47,7 +47,7 @@ Pega SDK packages (`.tgz` files) have been added to the project root and referen
|
|
|
47
47
|
|
|
48
48
|
### SDK Configuration
|
|
49
49
|
|
|
50
|
-
`sdk-config.json` contains connection details for the Pega server. The
|
|
50
|
+
`sdk-config.json` contains connection details for the Pega server. The AI assistant gathers the server URL, app alias, OAuth client ID, and (when the MCP configuration requires one) a client secret from the user in chat the first time a workflow needs them, and fills them in automatically — see `{{SKILL_DIR}}/connect-pega-server.md`. The case type is resolved from the server during the embedded flow itself.
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
@@ -55,6 +55,10 @@ Once design system, base folder, and type scope are resolved, continue to Step 0
|
|
|
55
55
|
|
|
56
56
|
⛔ **This step MUST complete before anything is read, installed, or written.** A portal renders a specific set of components, and generating the full catalogue produces components the portal will never mount. Do NOT use a hardcoded component list, and do NOT infer one from the project's existing folders.
|
|
57
57
|
|
|
58
|
+
### 0.5.0 — Ensure the Pega server connection is configured
|
|
59
|
+
|
|
60
|
+
Before executing any data source below, read and execute `{{SKILL_DIR}}/connect-pega-server.md`. It is a no-op when the connection is already configured, and otherwise gathers the missing values from the user and writes them into the MCP config and `sdk-config.json` before this step continues.
|
|
61
|
+
|
|
58
62
|
### 0.5.1 — Resolve the portal
|
|
59
63
|
|
|
60
64
|
Execute the data source **`D_pyAvailablePortals`**, which returns the portals 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.
|
|
@@ -70,6 +74,7 @@ The response's `pxResults` array holds one entry per portal. Then:
|
|
|
70
74
|
1. If the user's message did NOT name a portal, present the returned portals as a numbered pick-list and ask which one to generate for.
|
|
71
75
|
2. If the user's message DID name 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 portal name.
|
|
72
76
|
3. Record the confirmed entry's **`pyPortalLayout`** value. This — not the display label shown to the user — is what Steps 0.5.3 and 0.5.4 pass to the server as `PortalName`; carry it forward exactly as the data page returned it.
|
|
77
|
+
4. Write the confirmed `pyPortalLayout` value into `sdk-config.json` field `serverConfig.appPortal`.
|
|
73
78
|
|
|
74
79
|
### 0.5.2 — Ask what to convert
|
|
75
80
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
ai-description: Ensure the Pega server connection (MCP config + sdk-config.json) is configured before any workflow executes a live Pega data source. Not a standalone flow — invoked as a prerequisite step by other skills/prompts.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Pega Server Connection Gate
|
|
6
|
+
|
|
7
|
+
Run this **before** the first Pega data source is executed in a chat session. It ensures the MCP server this session talks to, and `sdk-config.json`, both carry real connection values instead of the placeholder markers the project scaffolding step leaves behind. Scaffolding never asks for these — this gate is where they are actually collected, the first time a workflow needs them.
|
|
8
|
+
|
|
9
|
+
## 1. Locate the MCP config file
|
|
10
|
+
|
|
11
|
+
Find the file this session's AI tool reads its Pega MCP server list from. Do not assume a fixed name or path, and do not ask the user which file to edit — discover it by what it contains: a server entry whose key starts with `pega-`, holding a `url` that points at an `/api/service/v1/mcp/` endpoint. Search the project for a file matching that shape.
|
|
12
|
+
|
|
13
|
+
## 2. Check whether it is already configured
|
|
14
|
+
|
|
15
|
+
Read that file and `sdk-config.json`. Treat the connection as **already configured** only when none of the following markers remain, literally, in either file: `{InfinityURL}`, `{AppAlias}`, `{MCPRuleName}`, `{MCPRuleInsKey}`, `{ClientId}`, `{ClientSecret}`, and `sdk-config.json`'s `serverConfig.infinityRestServerUrl` / `serverConfig.appAlias` / `authConfig.mashupClientId` are non-empty.
|
|
16
|
+
|
|
17
|
+
If already configured, skip the rest of this gate and continue with the workflow that invoked it.
|
|
18
|
+
|
|
19
|
+
## 3. Ask only for what is still missing
|
|
20
|
+
|
|
21
|
+
Check each value independently — ask only for the ones still a marker or blank, never re-ask for a value already present:
|
|
22
|
+
|
|
23
|
+
- Pega server URL
|
|
24
|
+
- Application alias
|
|
25
|
+
- OAuth client ID
|
|
26
|
+
- MCP rule name
|
|
27
|
+
- MCP rule instance key
|
|
28
|
+
- **Client secret — only if the MCP config's server entry has an `auth` block containing a `clientSecret` field.** Some MCP configurations authenticate this way and some do not; let the file's own structure decide whether to ask, rather than deciding by which AI tool is running. If there is no `auth` block, do not ask for a client secret at all.
|
|
29
|
+
|
|
30
|
+
Ask these as a single batch of questions, not one at a time.
|
|
31
|
+
|
|
32
|
+
## 4. Write the values
|
|
33
|
+
|
|
34
|
+
**MCP config file** — replace each marker with the value collected for it, and rename the `pega-{MCPRuleName}` server key using the real rule name:
|
|
35
|
+
|
|
36
|
+
- `{InfinityURL}` → server URL
|
|
37
|
+
- `{AppAlias}` → application alias
|
|
38
|
+
- `{MCPRuleName}` → MCP rule name (in both the server key and the URL path)
|
|
39
|
+
- `{MCPRuleInsKey}` → MCP rule instance key
|
|
40
|
+
- `{ClientId}` → client ID, if the entry has an `auth` block
|
|
41
|
+
- `{ClientSecret}` → client secret, if the `auth` block has that field
|
|
42
|
+
|
|
43
|
+
**`sdk-config.json`** — write into the existing structure, do not create new fields:
|
|
44
|
+
|
|
45
|
+
- `serverConfig.infinityRestServerUrl` → server URL
|
|
46
|
+
- `serverConfig.appAlias` → application alias
|
|
47
|
+
- `authConfig.mashupClientId` → client ID
|
|
48
|
+
- `authConfig.portalClientId` → client ID (same value as `mashupClientId`)
|
|
49
|
+
|
|
50
|
+
Never write the client secret into `sdk-config.json` — it belongs only in the MCP config file's `auth.clientSecret`.
|
|
51
|
+
|
|
52
|
+
## 5. Tell the user to reconnect
|
|
53
|
+
|
|
54
|
+
Most AI tools read their MCP config once at startup. After writing these values, tell the user the MCP server configuration changed and they need to reload or reconnect it (tool-dependent — e.g. restarting the MCP connection or reloading the window) before their request can proceed, and ask them to retry once reconnected.
|