Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/simulator/docs/user-flows/cdu-page-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Corezoid with `path: '/get'` or `'/send'` plus `{ page, query, context }` and `s
{
"code": 200,
"data": {
"title": "My orders", // optional; browser tab title of the page
"grid": { /* Grid — layout */ },
"forms": [ /* Form[] — content */ ],
"query": { /* echoed/updated query */ },
Expand Down Expand Up @@ -141,6 +142,7 @@ The render tree is **Page → Grid → Form → Section → Item**:

```
Page
├─ title? browser tab title; falls back to a host-composed name
├─ grid layout: column model, header, sidebar, region→form mapping
└─ forms[] one or more Form
├─ (grid?) a form may carry its own nested grid
Expand Down
2 changes: 1 addition & 1 deletion plugins/simulator/mcp-server/internal/tools/smartforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var smartFormOps = []Operation{
{
Name: "appGetPage", Method: "GET", Path: "/pages/{accId}/{ref}/{envTitle}/{page}",
Summary: "Render one page of a Smart Form (CDU / Script application) — the runtime equivalent of opening " +
"the app's page in the UI. Returns a Page `{ grid, forms[], notifications[], query, language }` " +
"the app's page in the UI. Returns a Page `{ title, grid, forms[], notifications[], query, language }` " +
"(code 200); the env's Corezoid process supplies the dynamic viewModel/data. Read `forms[].sections[].content[]` " +
"to see the components (items) to fill, and `notifications[]` for messages from the process. Then submit with " +
"appSendForm. Start a flow at page `index`. Smart Forms are addressed by (accId, ref, envTitle); use the " +
Expand Down
38 changes: 38 additions & 0 deletions plugins/simulator/skills/simulator-smart-forms/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,44 @@ The page `config` is the layout template. Structure: **Page → Grid → Form
}
```

### Page (root of `config`)

```jsonc
{
"title": "My orders", // browser tab title; see below
"grid": { /* layout */ },
"forms": [ /* content */ ],
"language": "uk", // base locale for [[…]] and date formatting
"styleClass": "orders-page",
"query": { "ref": "{{ref}}" },
"notifications": [ /* shown when the page opens */ ]
}
```

`title` names the browser tab. Omit it and the tab is named by the host
application — `<page> - <script ref>`, or the script ref alone on the `index`
page. A Smart Form embedded into another screen (a modal, a section header)
never renames the browser tab, whether a title is set or not.

**A whole value may be a placeholder.** `query`, `notifications` and `extra` are
resolved server-side, so any of them can be written as a single `{{viewModel}}`
or `[[locale]]` token and arrive as an object or an array:

```jsonc
"query": "{{query}}", // → object
"notifications": "{{messages}}", // → array
"extra": "{{pageExtra}}" // → object
```

The token has to be the entire string — with text around it the result is
always a string. The same holds inside `grid.header`, where every nested key is
resolved (`"extra": { "steps": "{{steps}}" }`).

Not everything is resolved, and a placeholder written in the wrong place is
silently left as literal text: `grid.type`, `grid.styleClass`, `grid.sideBar`,
`grid.header.class` and the keys **inside** a page-level `extra` are all taken
as written.

### Grid

```jsonc
Expand Down
Loading