@joomengine/joomla-mcp 0.7.0 → 0.8.0
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/CHANGELOG.md +59 -0
- package/README.md +88 -4
- package/dist/application/custom-fields.d.ts +28 -0
- package/dist/application/custom-fields.d.ts.map +1 -0
- package/dist/application/custom-fields.js +169 -0
- package/dist/application/custom-fields.js.map +1 -0
- package/dist/application/joomla-service.d.ts +1 -1
- package/dist/application/joomla-service.d.ts.map +1 -1
- package/dist/application/joomla-service.js +54 -2
- package/dist/application/joomla-service.js.map +1 -1
- package/dist/application/joomla-write-service.d.ts +4 -4
- package/dist/application/joomla-write-service.d.ts.map +1 -1
- package/dist/application/joomla-write-service.js +152 -70
- package/dist/application/joomla-write-service.js.map +1 -1
- package/dist/application/menu-component-binding.d.ts +24 -0
- package/dist/application/menu-component-binding.d.ts.map +1 -0
- package/dist/application/menu-component-binding.js +223 -0
- package/dist/application/menu-component-binding.js.map +1 -0
- package/dist/application/template-style-inheritance.d.ts +9 -0
- package/dist/application/template-style-inheritance.d.ts.map +1 -0
- package/dist/application/template-style-inheritance.js +104 -0
- package/dist/application/template-style-inheritance.js.map +1 -0
- package/dist/catalog/action-catalog.d.ts +3 -1
- package/dist/catalog/action-catalog.d.ts.map +1 -1
- package/dist/catalog/action-catalog.js +64 -14
- package/dist/catalog/action-catalog.js.map +1 -1
- package/dist/catalog/companion-actions.d.ts.map +1 -1
- package/dist/catalog/companion-actions.js +20 -2
- package/dist/catalog/companion-actions.js.map +1 -1
- package/dist/catalog/crud-write-fields.js +1 -1
- package/dist/catalog/crud-write-fields.js.map +1 -1
- package/dist/contracts/article-text.d.ts +9 -0
- package/dist/contracts/article-text.d.ts.map +1 -0
- package/dist/contracts/article-text.js +29 -0
- package/dist/contracts/article-text.js.map +1 -0
- package/dist/contracts/subform-json.d.ts +3 -0
- package/dist/contracts/subform-json.d.ts.map +1 -0
- package/dist/contracts/subform-json.js +104 -0
- package/dist/contracts/subform-json.js.map +1 -0
- package/dist/live-test/fixtures.d.ts.map +1 -1
- package/dist/live-test/fixtures.js +8 -4
- package/dist/live-test/fixtures.js.map +1 -1
- package/dist/live-test/runner.d.ts +4 -0
- package/dist/live-test/runner.d.ts.map +1 -1
- package/dist/live-test/runner.js +138 -13
- package/dist/live-test/runner.js.map +1 -1
- package/dist/mcp/create-server.d.ts.map +1 -1
- package/dist/mcp/create-server.js +8 -40
- package/dist/mcp/create-server.js.map +1 -1
- package/dist/security/confirmation-service.d.ts +4 -0
- package/dist/security/confirmation-service.d.ts.map +1 -1
- package/dist/security/confirmation-service.js +11 -0
- package/dist/security/confirmation-service.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/API_ACTIONS.md +14 -12
- package/docs/ARTICLE_TEXT.md +72 -0
- package/docs/CLIENTS.md +25 -38
- package/docs/COMPANION_RUNTIME_PARITY.md +51 -0
- package/docs/COVERAGE.md +1 -1
- package/docs/CUSTOM_FIELDS.md +202 -0
- package/docs/DEPLOYMENT.md +26 -12
- package/docs/FIXTURES.md +1 -1
- package/docs/LIBRARY.md +3 -3
- package/docs/MENU_COMPONENT_BINDING.md +90 -0
- package/docs/PHP_COMPANION.md +3 -3
- package/docs/RELEASING.md +52 -19
- package/docs/SINGLE_SITE.md +1 -1
- package/docs/TEMPLATE_STYLE_INHERITANCE.md +53 -0
- package/docs/TROUBLESHOOTING.md +1 -1
- package/examples/embedded-host/package.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Custom field definitions and values
|
|
2
|
+
|
|
3
|
+
## Assigning field definitions to categories
|
|
4
|
+
|
|
5
|
+
All six field contexts accept `assigned_cat_ids` on create and update through API and companion transports. Supply up to 1,000 integer category IDs. `[0]` or `[]` means All; `[-1]` means None. Joomla ignores zero when positive IDs are selected and makes None override other selections. `only_use_in_subform: 1` makes Joomla save `[-1]` regardless of the submitted assignment. This is the native field form contract; Joomla decides whether an installed context supports categories.
|
|
6
|
+
|
|
7
|
+
Omitted assignments survive a partial update. API updates recover this separate relation from the authorized item read; companion updates retain it from the native field model. Explicit selections, including clearing with `[]`, take precedence. Item read-back includes `assigned_cat_ids`; category assignments are not returned by Joomla's stock list response.
|
|
8
|
+
|
|
9
|
+
## Creating field definitions
|
|
10
|
+
|
|
11
|
+
All six `fields.*.create` actions supply `default_value: ""` when that property is
|
|
12
|
+
omitted, matching Joomla's administrator form. This applies to article, content
|
|
13
|
+
category, contact, contact-mail, contact-category and user fields through both
|
|
14
|
+
API and companion transports. It prevents new fields from storing an unintended
|
|
15
|
+
SQL `NULL` that triggers a `DOMCdataSection` deprecation when an editor prepares
|
|
16
|
+
the field.
|
|
17
|
+
|
|
18
|
+
The fallback is part of the approved create payload. Explicit caller values are
|
|
19
|
+
preserved for Joomla's native validation, and `fields.*.update` does not receive
|
|
20
|
+
a default when the property is omitted. Field-group actions are unaffected.
|
|
21
|
+
|
|
22
|
+
These same native field-create actions complete an omitted `description` with
|
|
23
|
+
`""` and an omitted `params` with the administrator form defaults:
|
|
24
|
+
`show_on: ""`, `showlabel: "1"`, `display: "2"`, `display_readonly: "2"`,
|
|
25
|
+
`searchindex: "0"`. An empty params object disappears during Joomla form
|
|
26
|
+
filtering and does not provide the non-null database column. The populated
|
|
27
|
+
default group prevents the reported missing-description/params SQL failure.
|
|
28
|
+
The values come from [Joomla 6.1.4 field.xml](https://github.com/joomla/joomla-cms/blob/6.1.4/administrator/components/com_fields/forms/field.xml).
|
|
29
|
+
Explicit descriptions and parameter values remain unchanged, including null
|
|
30
|
+
or empty groups for Joomla to validate. Partial updates receive no defaults.
|
|
31
|
+
|
|
32
|
+
Existing fields are not rewritten automatically. To repair an affected field,
|
|
33
|
+
read its ID through the matching `fields.*.list` action, then plan and approve a
|
|
34
|
+
matching `fields.*.update` with `data.default_value` set to an empty string.
|
|
35
|
+
Keep any intentional nonempty default.
|
|
36
|
+
|
|
37
|
+
To test [issue #42](https://github.com/joomengine/joomla-mcp/issues/42), create a
|
|
38
|
+
text field without `default_value`, confirm the saved value is an empty string,
|
|
39
|
+
and open the corresponding Joomla editor with deprecation reporting enabled.
|
|
40
|
+
Also create a field with an explicit nonempty default and update only its title;
|
|
41
|
+
the original default must remain unchanged. Report the action, transport, Joomla
|
|
42
|
+
and PHP versions, and redacted result if the warning persists.
|
|
43
|
+
|
|
44
|
+
## Writing field values
|
|
45
|
+
|
|
46
|
+
API create and update plans accept the names of published custom fields from the
|
|
47
|
+
selected Joomla site. This applies to `content.articles`, `content.categories`,
|
|
48
|
+
`contacts.contacts` and `users.users`, and to the typed
|
|
49
|
+
`joomla_content_article_create_plan` and `joomla_content_article_update_plan` tools.
|
|
50
|
+
|
|
51
|
+
Enable the matching field-list read toolset alongside the action's write toolset:
|
|
52
|
+
`structure.read` for articles, content categories and contacts, or `users.read`
|
|
53
|
+
for users. Give the Joomla API identity permission to read the corresponding
|
|
54
|
+
field definitions. Remote MCP principals also need that read scope. Existing core-field-only plans do not need
|
|
55
|
+
field discovery. Use `joomla_action_describe` for the selected action and site to
|
|
56
|
+
inspect resolved custom field names and their Joomla types.
|
|
57
|
+
|
|
58
|
+
## Article example
|
|
59
|
+
|
|
60
|
+
On the site and article from issue #38, a generic dry run is:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"action": "content.articles.update",
|
|
65
|
+
"transport": "api",
|
|
66
|
+
"dryRun": true,
|
|
67
|
+
"idempotencyKey": "3f38a5e5-6ff1-4aad-90e4-ff9389973928",
|
|
68
|
+
"input": {
|
|
69
|
+
"id": 9,
|
|
70
|
+
"data": {
|
|
71
|
+
"teamleden": "{\"row0\":{\"field1\":\"Sample team member\"}}"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The example requires the existing `teamleden` field and article `9`. The nested
|
|
78
|
+
subform keys must match that field's real configuration; discover those settings
|
|
79
|
+
and use the native value shape accepted by its Joomla field plugin. The adapter
|
|
80
|
+
does not invent, convert or double-encode custom field values.
|
|
81
|
+
|
|
82
|
+
The equivalent alias is `"data": {"com_fields": {"teamleden": "..."}}`.
|
|
83
|
+
Supplying the same field both at the top level and inside `com_fields` is rejected.
|
|
84
|
+
Core form keys cannot be smuggled through the alias.
|
|
85
|
+
Custom field `null` values are rejected because Joomla's top-level preprocessing
|
|
86
|
+
skips them; use an empty string or empty array when that field type supports
|
|
87
|
+
clearing a value.
|
|
88
|
+
|
|
89
|
+
For a real write, obtain the normal operator grant, omit `dryRun`, use a fresh
|
|
90
|
+
idempotency UUID, review the returned plan, then call `joomla_write_apply` with its
|
|
91
|
+
confirmation token. Planning and applying remain separate. A dry run performs
|
|
92
|
+
field reads but no mutation.
|
|
93
|
+
|
|
94
|
+
## Validation and transport contract
|
|
95
|
+
|
|
96
|
+
Only matching published definitions in the expected context are accepted;
|
|
97
|
+
unpublished field groups and unknown names are excluded. Discovery uses bounded
|
|
98
|
+
pages from fixed catalogue routes. A failed or incomplete lookup fails closed.
|
|
99
|
+
Prototype keys and core-field collisions are rejected, and the normal JSON/body
|
|
100
|
+
limits remain enforced. Each plan binds resolved field metadata and normalized
|
|
101
|
+
values so a later field-list change cannot introduce extra approved keys.
|
|
102
|
+
|
|
103
|
+
Purely numeric field names such as `0` or `123` are excluded from discovery and
|
|
104
|
+
rejected in writes because PHP's associative JSON decoding cannot safely retain
|
|
105
|
+
their object-key shape. Rename these fields to include a letter, hyphen or
|
|
106
|
+
underscore. Numeric-leading names such as `2026-reference` remain supported.
|
|
107
|
+
|
|
108
|
+
| Resource | Joomla field context | API body sent |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| Articles | `com_content.article` | Custom field names at the top level |
|
|
111
|
+
| Content categories | `com_content.categories` | Custom values inside `com_fields` |
|
|
112
|
+
| Contacts | `com_contact.contact` | Custom field names at the top level |
|
|
113
|
+
| Users | `com_users.user` | Custom field names at the top level |
|
|
114
|
+
|
|
115
|
+
Joomla remains responsible for per-item applicability, category/language/access
|
|
116
|
+
restrictions, field-value validation, ACL, plugin events and persistence. Stock
|
|
117
|
+
Joomla 6.1/6.2 field-list and field-detail API output does not expose
|
|
118
|
+
`only_use_in_subform`; a field listed there is not proof that it can be saved as a
|
|
119
|
+
standalone item field. Verify persistence using Joomla readback and the native
|
|
120
|
+
editor, particularly for subforms. Live site testing remains necessary.
|
|
121
|
+
|
|
122
|
+
This addition supports the API transport. The local companion does not gain
|
|
123
|
+
custom-field write support in this change. Select `transport: "api"` when using
|
|
124
|
+
the generic tool on a site with both adapters.
|
|
125
|
+
|
|
126
|
+
## Subform JSON read-back
|
|
127
|
+
|
|
128
|
+
An approved field of type `subform` is compared by its decoded outer JSON
|
|
129
|
+
serialization. Formatting, escaped slashes, Unicode escape spelling and object
|
|
130
|
+
key order may change without changing the field value. List order and length,
|
|
131
|
+
object/list shape, nested text and scalar types remain significant. Native JSON
|
|
132
|
+
numbers such as `1` and `1.0` compare equally. Raw numeric tokens must round-trip
|
|
133
|
+
through native JSON decoding without changing their decimal value; rounding,
|
|
134
|
+
underflow, non-finite numbers and values beyond the safe integer range cannot
|
|
135
|
+
establish a match. Quoted numeric text stays text. Inputs remain bounded to 1 MiB
|
|
136
|
+
and 64 nesting levels. An explicit empty-string clear operation is preserved.
|
|
137
|
+
|
|
138
|
+
The TypeScript API write result retains its existing `verification.status`,
|
|
139
|
+
`headers` and raw `data`. For approved subform values it also supplies
|
|
140
|
+
`verification.customFieldVerification`, with `scope: "subform-custom-fields"`,
|
|
141
|
+
`status`, `matchedFields`, `differentFields` and `unobservableFields`. Its status
|
|
142
|
+
is `verified` only for matched subform values, `partial` when a matching resource
|
|
143
|
+
does not expose a requested value, and `uncertain` for an actual mismatch or
|
|
144
|
+
wrong read-back identity. This evidence does not certify other requested fields.
|
|
145
|
+
Uncertain field evidence emits a failed write audit event. The accepted mutation
|
|
146
|
+
and its read-back evidence remain cached under the idempotency key, so another
|
|
147
|
+
plan with the same key returns the existing outcome without resubmitting it.
|
|
148
|
+
|
|
149
|
+
Configured live-test writes use their approved plan's field metadata for the same
|
|
150
|
+
comparison, including category `com_fields` aliases. Text fields retain their
|
|
151
|
+
ordinary comparisons even when their contents resemble JSON. No field discovery
|
|
152
|
+
is repeated during production apply.
|
|
153
|
+
|
|
154
|
+
The PHP component reports matched subform saves as `verification.status:
|
|
155
|
+
"verified"` and releases their durable write lease. Existing uncertain executions
|
|
156
|
+
still require administrator inspection and reconciliation; installing the fix
|
|
157
|
+
does not retry an old write or automatically clear its lease. The TypeScript
|
|
158
|
+
server does not have the PHP component's persistent `WRITE_BUSY` store.
|
|
159
|
+
|
|
160
|
+
A generic HTTP 400 response does not prove there were no effects. Joomla 6.1.4
|
|
161
|
+
[saves before check-in](https://github.com/joomla/joomla-cms/blob/6.1.4/libraries/src/MVC/Controller/ApiController.php),
|
|
162
|
+
and a later failure is [returned as HTTP 400](https://github.com/joomla/joomla-cms/blob/6.1.4/libraries/src/Error/JsonApi/CheckinCheckoutExceptionHandler.php).
|
|
163
|
+
Inspect ambiguous failures before retrying; the PHP component retains its
|
|
164
|
+
uncertain execution and lease when the mutation outcome cannot be established.
|
|
165
|
+
|
|
166
|
+
## Acceptance testing
|
|
167
|
+
|
|
168
|
+
Use a disposable site or test content and retain original values for cleanup.
|
|
169
|
+
|
|
170
|
+
1. Describe article create/update actions and confirm the expected published
|
|
171
|
+
field names/types. Check that another site's fields do not appear.
|
|
172
|
+
2. Dry-run a text value and the site's actual repeatable/subform value through
|
|
173
|
+
both generic and typed article tools. Confirm an unknown name, unpublished
|
|
174
|
+
field, wrong-context field and duplicate alias are rejected before mutation.
|
|
175
|
+
3. Create a test article with values, then update only a custom field. Apply the
|
|
176
|
+
approved plans and inspect values in the article API and Joomla editor.
|
|
177
|
+
Confirm omitted article text and unrelated fields remain unchanged.
|
|
178
|
+
4. Repeat an update with the `com_fields` alias and compare the saved result.
|
|
179
|
+
5. Check denial without field-read authorization; then restore it and re-plan.
|
|
180
|
+
No mutation should occur from a failed plan.
|
|
181
|
+
6. Test category, contact and user contexts where the site uses them; check the
|
|
182
|
+
category's nested payload and native form validation. Remove test content and
|
|
183
|
+
restore any changed field settings afterward.
|
|
184
|
+
|
|
185
|
+
Report the Joomla version, MCP commit, action/transport, field type and redacted
|
|
186
|
+
input/result on [issue #38](https://github.com/joomengine/joomla-mcp/issues/38).
|
|
187
|
+
Never include API tokens, confirmation tokens or private content.
|
|
188
|
+
|
|
189
|
+
## Joomla source authority
|
|
190
|
+
|
|
191
|
+
The following contracts were reviewed on `6.1-dev` and `6.2-dev`:
|
|
192
|
+
|
|
193
|
+
- `api/components/com_content/src/Controller/ArticlesController.php`
|
|
194
|
+
- `api/components/com_contact/src/Controller/ContactController.php`
|
|
195
|
+
- `api/components/com_users/src/Controller/UsersController.php`
|
|
196
|
+
- `api/components/com_categories/src/Controller/CategoriesController.php`
|
|
197
|
+
- `api/components/com_fields/src/Controller/FieldsController.php`
|
|
198
|
+
- `api/components/com_fields/src/View/Fields/JsonapiView.php`
|
|
199
|
+
- `libraries/src/MVC/Controller/ApiController.php`
|
|
200
|
+
- `plugins/system/fields/src/Extension/Fields.php`
|
|
201
|
+
|
|
202
|
+
These files are in [Joomla core](https://github.com/joomla/joomla-cms).
|
package/docs/DEPLOYMENT.md
CHANGED
|
@@ -40,11 +40,13 @@ are in [AI client connections](CLIENTS.md).
|
|
|
40
40
|
|
|
41
41
|
## Release artifacts and manual release
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
Start **Actions → Release → Run workflow** on `main`. The release workflow
|
|
44
|
+
synchronizes and validates the chosen version, anchors it with an immutable
|
|
45
|
+
tag, and dispatches publication on `main` with the exact source commit.
|
|
46
|
+
Publication checks out that commit and coordinates npm, OCI, and GitHub
|
|
47
|
+
release artifacts. Pull requests, merges, and pushed tags do not trigger
|
|
48
|
+
publication. See [Versioning and releases](RELEASING.md) for strategies,
|
|
49
|
+
approval gates, and recovery.
|
|
48
50
|
|
|
49
51
|
Each release contains:
|
|
50
52
|
|
|
@@ -53,12 +55,13 @@ Each release contains:
|
|
|
53
55
|
configuration, operations, and client runbooks;
|
|
54
56
|
- `pkg_joomlamcp-X.Y.Z.zip` — Joomla companion package;
|
|
55
57
|
- `joomengine-mcp-for-joomla-vX.Y.Z.spdx.json` — source SBOM;
|
|
58
|
+
- `release-manifest.json` — exact source, package, image, and asset identities;
|
|
56
59
|
- `SHA256SUMS` — checksums for every downloadable asset;
|
|
57
60
|
- an attested OCI image at
|
|
58
|
-
`ghcr.io
|
|
61
|
+
`ghcr.io/joomengine/joomla-mcp:X.Y.Z` and `:vX.Y.Z`.
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
After merging the 0.8.0 preparation, run Release with strategy `current` to
|
|
64
|
+
publish that version. Strategy `auto` also selects it while unreleased.
|
|
62
65
|
|
|
63
66
|
## Stdio installation
|
|
64
67
|
|
|
@@ -77,10 +80,21 @@ process should run as a dedicated account when it can reach a production site.
|
|
|
77
80
|
|
|
78
81
|
## OCI and Docker Compose
|
|
79
82
|
|
|
80
|
-
Release images are published to `ghcr.io/joomengine/joomla-mcp`
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
Release images are published to `ghcr.io/joomengine/joomla-mcp` with tags
|
|
84
|
+
aligned to the npm version:
|
|
85
|
+
|
|
86
|
+
| Tag | Meaning |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `0.8.0` and `v0.8.0` | Immutable tags for the same 0.8.0 release digest |
|
|
89
|
+
| `sha-<commit>` | Immutable image built from the exact release commit |
|
|
90
|
+
| `latest` | Latest verified stable release |
|
|
91
|
+
| `next` | Latest verified prerelease; does not change `latest` |
|
|
92
|
+
|
|
93
|
+
The workflow promotes `latest` or `next` only after verifying the matching npm
|
|
94
|
+
version's integrity and channel, and rejects channel version regressions.
|
|
95
|
+
Verify provenance and pin production deployments by digest, for example
|
|
96
|
+
`ghcr.io/joomengine/joomla-mcp@sha256:<digest>`. The moving channel tags are
|
|
97
|
+
convenient for discovery; the rollout script requires an immutable digest.
|
|
84
98
|
|
|
85
99
|
From the repository root:
|
|
86
100
|
|
package/docs/FIXTURES.md
CHANGED
|
@@ -114,7 +114,7 @@ On each fixture:
|
|
|
114
114
|
|
|
115
115
|
1. Build or download the companion ZIP whose digest is under test.
|
|
116
116
|
2. Install it through Joomla's native extension installer.
|
|
117
|
-
3. Verify **Console - JoomEngine MCP for Joomla Companion** is enabled. Version 0.
|
|
117
|
+
3. Verify **Console - JoomEngine MCP for Joomla Companion** is enabled. Version 0.8.0 and
|
|
118
118
|
later enable it on first installation while preserving state on upgrades.
|
|
119
119
|
4. Select a dedicated **MCP actor user** with only the permissions for the
|
|
120
120
|
current test group. An unset actor is a required denial case.
|
package/docs/LIBRARY.md
CHANGED
|
@@ -10,7 +10,7 @@ registration code.
|
|
|
10
10
|
Pin a compatible version in the consuming application:
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npm install @joomengine/joomla-mcp@^0.
|
|
13
|
+
npm install @joomengine/joomla-mcp@^0.8.0
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
For exact, reproducible deployments:
|
|
@@ -18,7 +18,7 @@ For exact, reproducible deployments:
|
|
|
18
18
|
```json
|
|
19
19
|
{
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@joomengine/joomla-mcp": "0.
|
|
21
|
+
"@joomengine/joomla-mcp": "0.8.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
```
|
|
@@ -34,7 +34,7 @@ release asset:
|
|
|
34
34
|
```json
|
|
35
35
|
{
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@joomengine/joomla-mcp": "https://github.com/joomengine/joomla-mcp/releases/download/v0.
|
|
37
|
+
"@joomengine/joomla-mcp": "https://github.com/joomengine/joomla-mcp/releases/download/v0.8.0/joomengine-mcp-for-joomla-v0.8.0.tgz"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Menu component binding through the API
|
|
2
|
+
|
|
3
|
+
`menus.site-items.create/update` and `menus.administrator-items.create/update`
|
|
4
|
+
now persist Joomla's native `component_id` and verify the stored value. This fixes
|
|
5
|
+
[#39](https://github.com/joomengine/joomla-mcp/issues/39), where a created menu
|
|
6
|
+
could display “Component does not exist” in the administrator while a single-item
|
|
7
|
+
API read appeared correct.
|
|
8
|
+
|
|
9
|
+
Joomla's menu `ItemModel::getItem()` derives a component ID from the link, but
|
|
10
|
+
`save()` does not perform that derivation. The item getter can therefore mask a
|
|
11
|
+
stored zero or an outdated component ID. The collection response reads the stored
|
|
12
|
+
value and is the verification authority.
|
|
13
|
+
|
|
14
|
+
## Approved native execution
|
|
15
|
+
|
|
16
|
+
API menu plans require both `structure.write` and `structure.read`, including the
|
|
17
|
+
corresponding remote MCP scopes. Joomla still checks its API login and menu ACL.
|
|
18
|
+
Dry runs read and prepare metadata but perform no mutations.
|
|
19
|
+
|
|
20
|
+
The plan freezes the effective menu client, menu type identifier (`menutype`),
|
|
21
|
+
item type, link and form body. Partial updates read their current native form
|
|
22
|
+
context during planning. The preview and confirmation explicitly include the
|
|
23
|
+
following bounded workflow:
|
|
24
|
+
|
|
25
|
+
1. Apply the requested POST or PATCH with an internal `component_id` of zero.
|
|
26
|
+
Clearing it first prevents an unavailable replacement component from retaining
|
|
27
|
+
an old positive ID during Joomla's item read.
|
|
28
|
+
2. For a component menu, read the exact resulting item and check its ID, client,
|
|
29
|
+
item type, menu type identifier and complete link against the approved plan.
|
|
30
|
+
Accept only Joomla's positive derived component ID.
|
|
31
|
+
3. Perform one corrective PATCH using the approved form body and that derived
|
|
32
|
+
ID. Use a fresh ETag from the item read when available, and a deterministic
|
|
33
|
+
repair UUID distinct from the primary idempotency key.
|
|
34
|
+
4. Read the stored menu collection, narrowed by the approved `menutype`, and
|
|
35
|
+
verify the target item and `component_id`. Non-component menu items remain
|
|
36
|
+
at zero and skip the corrective PATCH.
|
|
37
|
+
|
|
38
|
+
No caller-selectable `component_id`, route, component lookup or arbitrary repair
|
|
39
|
+
request is added. Duplicate or array-shaped `option` parameters are rejected
|
|
40
|
+
before mutation. All reads use fixed catalogue routes and numeric pagination;
|
|
41
|
+
response-provided next URLs are never followed. Verification stops after 100
|
|
42
|
+
pages or 10,000 items.
|
|
43
|
+
|
|
44
|
+
## Outcomes and recovery
|
|
45
|
+
|
|
46
|
+
Apply returns an explicit `outcome`:
|
|
47
|
+
|
|
48
|
+
| Outcome | Meaning |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `verified` | The stored collection matches the approved menu binding. |
|
|
51
|
+
| `partial` | Joomla acknowledged the primary mutation, but a later step failed or persistence could not be verified. The response retains the mutation and item ID when available. |
|
|
52
|
+
| `uncertain` | The primary request failed without a conclusive response. Joomla may already have processed it. |
|
|
53
|
+
|
|
54
|
+
Partial and uncertain results are retained in the same principal-bound
|
|
55
|
+
idempotency cache as successful writes. Replanning with the same key cannot repeat
|
|
56
|
+
the original POST; a changed operation with that key is rejected. The existing
|
|
57
|
+
TypeScript cache is process-local and expires after 24 hours. Inspect the menu
|
|
58
|
+
before using a different key, after restarting the server, or after expiry.
|
|
59
|
+
|
|
60
|
+
An accepted write followed by a failed read is never reported as a verified
|
|
61
|
+
success. Joomla's native collection omits trashed menu items; a write that trashes
|
|
62
|
+
an item consequently reports an unverified partial outcome. Check the native
|
|
63
|
+
administrator and retain the returned item ID for recovery. Do not repeat a
|
|
64
|
+
create merely because the corrective PATCH or readback failed.
|
|
65
|
+
|
|
66
|
+
The local companion transport retains its existing native implementation. This
|
|
67
|
+
API correction does not add an extra companion command or a generic model route.
|
|
68
|
+
|
|
69
|
+
## Testing and authority
|
|
70
|
+
|
|
71
|
+
Offline tests reproduce the distinction between a derived item getter and a
|
|
72
|
+
stored collection. They cover both menu clients, cross-component links,
|
|
73
|
+
non-component transitions, read-scope denial, malformed derived IDs, fixed
|
|
74
|
+
pagination, identity mismatches, and replay after partial or uncertain results.
|
|
75
|
+
|
|
76
|
+
On a disposable Joomla site, create a component menu, update it to a different
|
|
77
|
+
installed component, and inspect the collection's stored ID and the native
|
|
78
|
+
administrator. Verify a title-only update repairs an existing zero. Exercise a
|
|
79
|
+
failed corrective PATCH and confirm that the same-key retry cannot create a
|
|
80
|
+
second item. Cleanup the test menus after retaining any failure evidence.
|
|
81
|
+
|
|
82
|
+
Source contracts reviewed in Joomla `6.1-dev` and `6.2-dev`:
|
|
83
|
+
|
|
84
|
+
- [Administrator menu ItemModel](https://github.com/joomla/joomla-cms/blob/6.1-dev/administrator/components/com_menus/src/Model/ItemModel.php): native item derivation and save lifecycle.
|
|
85
|
+
- [Administrator menu ItemsModel](https://github.com/joomla/joomla-cms/blob/6.1-dev/administrator/components/com_menus/src/Model/ItemsModel.php): stored collection and visibility rules.
|
|
86
|
+
- [API menu ItemsController](https://github.com/joomla/joomla-cms/blob/6.1-dev/api/components/com_menus/src/Controller/ItemsController.php): client and menu-type filters.
|
|
87
|
+
- [API menu JSON view](https://github.com/joomla/joomla-cms/blob/6.1-dev/api/components/com_menus/src/View/Items/JsonapiView.php): item and collection fields.
|
|
88
|
+
|
|
89
|
+
Offline tests are not a substitute for the live Joomla success, ACL, recovery and
|
|
90
|
+
cleanup matrix described in [CONTRIBUTING.md](../CONTRIBUTING.md).
|
package/docs/PHP_COMPANION.md
CHANGED
|
@@ -18,7 +18,7 @@ php companion/tests/run.php
|
|
|
18
18
|
php companion/build.php
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
The build produces `companion/dist/pkg_joomlamcp-0.
|
|
21
|
+
The build produces `companion/dist/pkg_joomlamcp-0.8.0.zip`. Install or upgrade
|
|
22
22
|
it through Joomla's native extension installer. First installation enables the
|
|
23
23
|
console plugin through Joomla's extension table lifecycle; upgrades preserve
|
|
24
24
|
the operator's enabled/disabled state. Then:
|
|
@@ -110,7 +110,7 @@ risk, supported Joomla range, declared ACL, and effective permission for the
|
|
|
110
110
|
configured actor. Refresh it after package installation/upgrade, Joomla upgrade,
|
|
111
111
|
actor ACL changes, or plugin configuration changes.
|
|
112
112
|
|
|
113
|
-
The companion 0.
|
|
113
|
+
The companion 0.8.0 allowlist contains 231 actions:
|
|
114
114
|
|
|
115
115
|
- 180 list/get/create/update/delete actions for the 36 fixed core entity bases;
|
|
116
116
|
- 28 model-state actions where the fixed Joomla model supports state changes;
|
|
@@ -123,7 +123,7 @@ method, path, URL, shell, PHP, SQL, or filesystem primitive.
|
|
|
123
123
|
|
|
124
124
|
## Native operational actions
|
|
125
125
|
|
|
126
|
-
Companion 0.
|
|
126
|
+
Companion 0.8.0 includes these fixed Joomla-native adapters:
|
|
127
127
|
|
|
128
128
|
| Action | Native Joomla capability |
|
|
129
129
|
|---|---|
|
package/docs/RELEASING.md
CHANGED
|
@@ -8,7 +8,7 @@ source commit:
|
|
|
8
8
|
| Node.js library and CLI | `@joomengine/joomla-mcp@<version>` |
|
|
9
9
|
| Installable npm tarball | `joomengine-mcp-for-joomla-v<version>.tgz` |
|
|
10
10
|
| Joomla companion | `pkg_joomlamcp-<version>.zip` |
|
|
11
|
-
| OCI image | `ghcr.io/joomengine/joomla-mcp
|
|
11
|
+
| OCI image | `ghcr.io/joomengine/joomla-mcp:<version>` and `:v<version>` |
|
|
12
12
|
| Self-hosted deployment bundle | `joomengine-mcp-for-joomla-deployment-v<version>.tar.gz` |
|
|
13
13
|
| Source SBOM | `joomengine-mcp-for-joomla-v<version>.spdx.json` |
|
|
14
14
|
| Machine-readable release contract | `release-manifest.json` |
|
|
@@ -19,11 +19,22 @@ package identity, Joomla manifests, companion-reported version, build filename,
|
|
|
19
19
|
tests, fixture, examples, changelog, and versioned documentation are verified
|
|
20
20
|
mirrors. `npm run version:check` fails on drift.
|
|
21
21
|
|
|
22
|
+
Both immutable OCI version tags and `sha-<commit>` resolve to the same image
|
|
23
|
+
digest. After the exact npm integrity and channel are verified, the stable
|
|
24
|
+
Docker channel advances to `latest`; prereleases advance only `next`. Channel
|
|
25
|
+
promotion rejects version regressions and never replaces a conflicting
|
|
26
|
+
immutable version tag.
|
|
27
|
+
|
|
22
28
|
## Maintainer release
|
|
23
29
|
|
|
24
30
|
Open **Actions → Release → Run workflow** on `main`.
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
After merging the 0.8.0 preparation, select **strategy** `current` and leave
|
|
33
|
+
**exact_version** blank to publish 0.8.0 (`auto` also selects 0.8.0 while it is
|
|
34
|
+
unreleased). Opening or merging the pull request does not publish a release.
|
|
35
|
+
|
|
36
|
+
For the normal path, leave **strategy** as `auto`, keep **exact_version** blank,
|
|
37
|
+
and run the workflow:
|
|
27
38
|
|
|
28
39
|
- if the repository version has no completed release, `auto` proposes that
|
|
29
40
|
current version;
|
|
@@ -69,13 +80,21 @@ versions use SemVer without build metadata, and numeric identifiers may not
|
|
|
69
80
|
exceed JavaScript's safe-integer limit. A release can never move behind either
|
|
70
81
|
the repository version or an immutable version tag.
|
|
71
82
|
|
|
83
|
+
The workflow validates these inputs before registry login or release-state
|
|
84
|
+
inspection. If a run fails because `exact_version` was entered with `auto` or
|
|
85
|
+
`current`, dispatch a **new** run with `strategy=current` and `exact_version`
|
|
86
|
+
blank to publish the repository version. To request a different explicit
|
|
87
|
+
version, select `strategy=exact` and supply `exact_version`. Conflicting inputs
|
|
88
|
+
are never silently ignored or used to change the selected strategy. Do not use
|
|
89
|
+
**Re-run jobs**, because it retains the invalid inputs.
|
|
90
|
+
|
|
72
91
|
## Release state machine
|
|
73
92
|
|
|
74
|
-
The one-click path uses two globally serialized workflows
|
|
75
|
-
plans and anchors the source
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
93
|
+
The one-click path uses two globally serialized workflows dispatched on
|
|
94
|
+
`main`. `release.yml` plans and anchors the source, then dispatches
|
|
95
|
+
`publish-release.yml` with the exact version and immutable release commit as
|
|
96
|
+
inputs. Publication checks out that commit explicitly and verifies its tag;
|
|
97
|
+
the workflow identity remains on `main` for npm trusted publishing.
|
|
79
98
|
|
|
80
99
|
The workflows run these phases:
|
|
81
100
|
|
|
@@ -90,9 +109,9 @@ The workflows run these phases:
|
|
|
90
109
|
4. **Anchor** — push a bumped main commit and annotated tag together with
|
|
91
110
|
`git push --atomic`. If `main` advanced, neither ref is pushed. An
|
|
92
111
|
unpublished current version only needs the tag.
|
|
93
|
-
5. **Dispatch
|
|
94
|
-
|
|
95
|
-
maintainer, tag, commit, and synchronized version.
|
|
112
|
+
5. **Dispatch publication** — start `publish-release.yml` on `main` with the
|
|
113
|
+
immutable release commit. The publication workflow independently verifies
|
|
114
|
+
the source run, maintainer, tag, commit, and synchronized version.
|
|
96
115
|
6. **Build** — check out the tag commit explicitly and build the
|
|
97
116
|
npm/deployment packages, Joomla companion, and SPDX SBOM with provenance
|
|
98
117
|
rooted in that exact commit.
|
|
@@ -102,12 +121,13 @@ The workflows run these phases:
|
|
|
102
121
|
8. **Approve publication** — require the protected `release` environment
|
|
103
122
|
again immediately before any registry publication.
|
|
104
123
|
9. **Seal** — publish or verify a commit-addressed OCI image, bind the
|
|
105
|
-
|
|
106
|
-
expected npm SHA-512 integrity into the final release
|
|
107
|
-
checksums.
|
|
124
|
+
bare and v-prefixed version tags to that registry digest, and seal both the
|
|
125
|
+
OCI digest and expected npm SHA-512 integrity into the final release
|
|
126
|
+
manifest and checksums.
|
|
108
127
|
10. **Publish** — upload and byte-verify the final draft assets, publish npm
|
|
109
128
|
directly to SemVer-derived `latest` or `next`, verify the registry
|
|
110
|
-
integrity/channel, and
|
|
129
|
+
integrity/channel, promote and verify the matching Docker channel, and make
|
|
130
|
+
the GitHub release public last.
|
|
111
131
|
|
|
112
132
|
Git, npm, GHCR, and GitHub Releases cannot participate in one cross-service
|
|
113
133
|
transaction. The draft-first, integrity-checked, resumable workflow provides
|
|
@@ -122,10 +142,14 @@ Create an environment named `release` and configure:
|
|
|
122
142
|
|
|
123
143
|
- required reviewers from the release-maintainer or system-administrator team;
|
|
124
144
|
- prevent self-review when at least two maintainers are available;
|
|
125
|
-
-
|
|
145
|
+
- administrator bypass disabled so the approval boundary cannot be skipped;
|
|
146
|
+
- no wait timer or custom deployment protection rule;
|
|
147
|
+
- deployment refs set to **Selected branches and tags**, with a branch rule for
|
|
148
|
+
`main` and a separate tag rule for `v*`;
|
|
126
149
|
- `NPM_TOKEN` only for the first npm bootstrap release, if required;
|
|
127
150
|
- optional `RELEASE_APP_ID` and `RELEASE_APP_PRIVATE_KEY` for the dedicated
|
|
128
|
-
release GitHub App
|
|
151
|
+
release GitHub App;
|
|
152
|
+
- no environment variables.
|
|
129
153
|
|
|
130
154
|
The actor permission check is defense in depth. Environment reviewers are the
|
|
131
155
|
human authorization boundary. A normal release asks for approval twice: first
|
|
@@ -167,7 +191,8 @@ For the first publication:
|
|
|
167
191
|
from SemVer, verifies the exact integrity and channel, then makes the
|
|
168
192
|
already-sealed GitHub release public.
|
|
169
193
|
4. Configure npm trusted publishing for organization `joomengine`, repository
|
|
170
|
-
`joomla-mcp`, workflow `publish-release.yml
|
|
194
|
+
`joomla-mcp`, workflow filename `publish-release.yml` (not the full path),
|
|
195
|
+
environment `release`, and allowed action **npm publish**.
|
|
171
196
|
5. Remove `NPM_TOKEN`. Later releases use GitHub OIDC with npm provenance.
|
|
172
197
|
|
|
173
198
|
Keeping the bootstrap token permanently defeats the purpose of trusted
|
|
@@ -208,7 +233,11 @@ when the requested version is already current.
|
|
|
208
233
|
Dispatch a new run with `auto` or `current` while the current version is
|
|
209
234
|
partial. Do not use GitHub's **Re-run jobs** button: every dispatch persists a
|
|
210
235
|
fresh release intent and artifact namespace. The workflow resumes from the
|
|
211
|
-
immutable source/tag and reconciles each boundary
|
|
236
|
+
immutable source/tag and reconciles each boundary. Recovery executes the
|
|
237
|
+
current, reviewed publication workflow from `main`, while all packages and
|
|
238
|
+
images are checked out and built from the exact commit anchored by the
|
|
239
|
+
immutable release tag. This allows workflow defects to be repaired without
|
|
240
|
+
moving a release tag or changing the released source:
|
|
212
241
|
|
|
213
242
|
- a tag must resolve to the same release commit;
|
|
214
243
|
- external npm or OCI state without that source tag is rejected as
|
|
@@ -216,10 +245,14 @@ immutable source/tag and reconciles each boundary:
|
|
|
216
245
|
- a draft may be updated only for that tag and exact asset allowlist;
|
|
217
246
|
- an existing npm version must have the same SHA-512 integrity;
|
|
218
247
|
- an existing OCI version tag must have the same manifest digest;
|
|
248
|
+
- both immutable OCI version aliases and the matching channel participate in
|
|
249
|
+
release-state checks; missing aliases make a release partial so `current`
|
|
250
|
+
or `auto` repairs them without incrementing the version;
|
|
219
251
|
- a public GitHub release must contain the exact byte-for-byte asset set;
|
|
220
252
|
- public-release recovery reuses those immutable assets and skips rebuilding
|
|
221
253
|
timestamp-sensitive artifacts such as the SBOM;
|
|
222
|
-
- the npm
|
|
254
|
+
- the npm and Docker channels must point at the exact version before GitHub
|
|
255
|
+
publication; recovering an older release cannot move either channel backward.
|
|
223
256
|
|
|
224
257
|
Any identity, integrity, digest, prerelease-state, or asset-contract mismatch
|
|
225
258
|
fails closed with the conflicting coordinate. Never delete and recreate a
|
package/docs/SINGLE_SITE.md
CHANGED
|
@@ -191,7 +191,7 @@ php companion/tests/run.php
|
|
|
191
191
|
php companion/build.php
|
|
192
192
|
cd /srv/www/joomla
|
|
193
193
|
php cli/joomla.php extension:install \
|
|
194
|
-
--path=/opt/joomla-mcp/companion/dist/pkg_joomlamcp-0.
|
|
194
|
+
--path=/opt/joomla-mcp/companion/dist/pkg_joomlamcp-0.8.0.zip
|
|
195
195
|
php cli/joomla.php joomla:mcp:self-test --format=json --no-interaction --no-ansi
|
|
196
196
|
```
|
|
197
197
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Template style creation
|
|
2
|
+
|
|
3
|
+
`templates.site-styles.create` and `templates.administrator-styles.create` create
|
|
4
|
+
styles for an already installed template. Supply `template`, `title`, and the
|
|
5
|
+
ordinary optional `home`/`params` fields. Install the template through Joomla
|
|
6
|
+
first; the adapter refuses to create a style if no existing style of that exact
|
|
7
|
+
template and client can be read.
|
|
8
|
+
|
|
9
|
+
The adapter reads Joomla's installed manifest through the existing style. It
|
|
10
|
+
derives the hidden `parent` and `inheritable` form fields, includes them in the
|
|
11
|
+
confirmation fingerprint and displayed preflight, and passes them to the native
|
|
12
|
+
save. A child such as a Cassiopeia child therefore retains its parent asset
|
|
13
|
+
registry. Absent or empty manifest elements have Joomla's installer defaults:
|
|
14
|
+
empty parent and `inheritable=0`. Parent templates retain `inheritable=1`.
|
|
15
|
+
Callers cannot set either hidden field directly.
|
|
16
|
+
|
|
17
|
+
API metadata reads require `structure.read` as well as the existing controlled
|
|
18
|
+
`structure.write` flow. Joomla's token still needs native API login and template
|
|
19
|
+
management/create permissions. A dry run only reads metadata. Apply rechecks
|
|
20
|
+
metadata and refuses a change since confirmation; request a fresh plan after
|
|
21
|
+
installing or changing the template. Native companion plans expose the same
|
|
22
|
+
derived metadata and the existing preflight comparison rejects changed values.
|
|
23
|
+
|
|
24
|
+
Reads stay on the selected site/client and are bounded to ten collection pages,
|
|
25
|
+
at most 100 rows per page (or the configured smaller API page size), and twenty
|
|
26
|
+
matching styles. All matching manifests must agree. Missing manifests, invalid
|
|
27
|
+
values, conflicting records, wrong-client records, duplicate pagination rows,
|
|
28
|
+
or exceeding a bound stop before creating a style. No parent is guessed from
|
|
29
|
+
the template name or copied from a different template.
|
|
30
|
+
|
|
31
|
+
## Joomla authority and validation
|
|
32
|
+
|
|
33
|
+
Reviewed Joomla 6.1 and 6.2 sources:
|
|
34
|
+
|
|
35
|
+
- `api/components/com_templates/src/View/Styles/JsonapiView.php`: list includes
|
|
36
|
+
`template` and `client_id`; item includes the parsed manifest as `xml`.
|
|
37
|
+
- `administrator/components/com_templates/src/Model/StyleModel.php`: `getItem`
|
|
38
|
+
reads the installed template's `templateDetails.xml` for that client; `save`
|
|
39
|
+
uses Joomla's normal table/events lifecycle.
|
|
40
|
+
- `administrator/components/com_templates/forms/style.xml`: hidden `parent`
|
|
41
|
+
and `inheritable` form fields.
|
|
42
|
+
- `libraries/src/Installer/Adapter/TemplateAdapter.php`: installation derives
|
|
43
|
+
these fields from the native manifest.
|
|
44
|
+
|
|
45
|
+
Offline API and native companion tests cover inherited, standalone, and parent
|
|
46
|
+
templates, both clients, non-mutating previews, permission denial, invalid
|
|
47
|
+
metadata, pagination limits, and metadata changes after approval. These tests
|
|
48
|
+
do not claim that a live Joomla page was rendered. To test the reported issue on
|
|
49
|
+
a disposable site, install a child template, create a style through MCP, assign
|
|
50
|
+
it to a test page, and confirm the page renders without the missing parent asset
|
|
51
|
+
error. Then unassign and delete the test style; retain the original installed
|
|
52
|
+
style so the template remains usable. Repeat with an ordinary parent template
|
|
53
|
+
and, where installed, an administrator child template.
|
package/docs/TROUBLESHOOTING.md
CHANGED
|
@@ -17,7 +17,7 @@ Inspect `compose-ps.txt`, `compose.log`, `describe.json`, `self-test.json`,
|
|
|
17
17
|
|
|
18
18
|
A companion installation can succeed while its command remains unavailable if
|
|
19
19
|
an older package installed the console plugin disabled. Install or upgrade to
|
|
20
|
-
0.
|
|
20
|
+
0.8.0, then verify `joomla:mcp:describe` as `www-data`. Do not reuse a failed
|
|
21
21
|
JoomEngine volume: its extension and configured CLI phases are first-install
|
|
22
22
|
only.
|
|
23
23
|
|