Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
be0d2c4
feature(mcp): Add MCPConfig utility class
LC43 Jul 8, 2026
3f6deb4
feature(mcp): Add mcp_route helper to RestTool base
LC43 Jul 8, 2026
ae70df0
test(mcp): Add tests for MCPConfig
LC43 Jul 8, 2026
6ef8831
feature(mcp): Refactor model meta tools to use MCPConfig
LC43 Jul 8, 2026
deb1465
feature(mcp): Refactor settings action tools to use MCPConfig
LC43 Jul 8, 2026
600b6f1
feature(mcp): Refactor REST controllers to use MCPConfig
LC43 Jul 8, 2026
e169e87
feature(model): add get_config to Model interface
LC43 Jul 8, 2026
7a219e1
feature(mcp): wire McpPolicy into AbilityRegistrar
LC43 Jul 8, 2026
3c3a44b
refactor(rest): switch from saltus_rest to config-section gating
LC43 Jul 8, 2026
126ad4d
fix(rest): update error hints to reflect new config syntax
LC43 Jul 8, 2026
bb31a54
test(mcp): add McpPolicyTest
LC43 Jul 8, 2026
313560a
test(rest): update REST tests for config-section gating
LC43 Jul 8, 2026
dae1ce0
docs: update MCP config filterability docs
LC43 Jul 8, 2026
b42b977
docs: update ROADMAP.md McpPolicy entry
LC43 Jul 8, 2026
32209fe
docs: update CURRENT.md McpPolicy progress
LC43 Jul 8, 2026
d050a2b
fix: use array lookup instead of match for PHP 7.4 compat
LC43 Jul 8, 2026
74961af
fix: add PHPStan type assertions to MCP config classes
LC43 Jul 8, 2026
af38fed
fix: add PHPStan type assertions to REST controllers
LC43 Jul 8, 2026
36db61d
Add guard for ability default props
LC43 Jul 8, 2026
8b3bbc8
CS
LC43 Jul 8, 2026
95c0f50
Add more guards
LC43 Jul 8, 2026
a20b060
Add more guards
LC43 Jul 8, 2026
8663b28
Add esc_url_raw stub function
LC43 Jul 8, 2026
3f2285d
Add defensive tests for MCP policy
LC43 Jul 8, 2026
d9383a6
Add initial MCP tool tests
LC43 Jul 8, 2026
2c2b9d8
Configure PHPUnit coverage settings
LC43 Jul 8, 2026
619c748
Gate sections cap
LC43 Jul 8, 2026
a600002
Update tests to match the caps
LC43 Jul 8, 2026
5cd7e98
More guards
LC43 Jul 8, 2026
6ed3378
CS
LC43 Jul 9, 2026
7b2baba
Simplify escaping rest route
LC43 Jul 9, 2026
986f5a6
Fix hints
LC43 Jul 9, 2026
0cd461c
Update docs
LC43 Jul 9, 2026
a6f27c1
Fix docs
LC43 Jul 9, 2026
69f1adf
Update docs
LC43 Jul 9, 2026
c682bb4
Update docs
LC43 Jul 9, 2026
34925ec
Prepare next phase in docs
LC43 Jul 9, 2026
83fbf60
CS
LC43 Jul 10, 2026
b092f11
CS
LC43 Jul 10, 2026
8235f2c
Use model built label when creating labels
LC43 Jul 10, 2026
2b39557
Update feature capabilities matrix
LC43 Jul 10, 2026
857c50b
infra(docs): gitignore generated docs artifacts
LC43 Jul 21, 2026
cfe294f
infra(docs): add npm vitepress dependency
LC43 Jul 21, 2026
b23f46a
infra(docs): add composer docs:all scripts
LC43 Jul 21, 2026
e77ec9b
infra(docs): add phpDocumentor configuration
LC43 Jul 21, 2026
1daf11a
infra(docs): add GitHub Actions workflow for docs deploy
LC43 Jul 21, 2026
7ff4a29
docs(site): configure VitePress navigation
LC43 Jul 21, 2026
bd5446c
docs(site): add landing page
LC43 Jul 21, 2026
65f2456
docs(site): set custom domain
LC43 Jul 21, 2026
4657b2c
docs(guides): add getting started page
LC43 Jul 21, 2026
40b97d2
docs(guides): add features reference page
LC43 Jul 21, 2026
5c967c1
docs(guides): add architecture page
LC43 Jul 21, 2026
b86fd71
docs(guides): add build page
LC43 Jul 21, 2026
03b3b37
docs(mcp): add overview page
LC43 Jul 21, 2026
a797ac8
docs(mcp): add abilities reference page
LC43 Jul 21, 2026
f97bebe
docs(mcp): add client integration guide
LC43 Jul 21, 2026
5bb7cba
docs(api): add API reference landing page
LC43 Jul 21, 2026
08a7f72
infra(docs): add WP-CLI doc generator stub
LC43 Jul 21, 2026
6e65f1a
docs(api): annotate Core Modeler as public api
LC43 Jul 21, 2026
0ddde10
docs(api): annotate Models namespace as public api
LC43 Jul 21, 2026
7d7d3c8
docs(api): annotate Rest infrastructure as public api
LC43 Jul 21, 2026
24c1f56
docs(api): annotate Rest controllers as public api
LC43 Jul 21, 2026
94abe69
docs(api): annotate MCP config policy as public api
LC43 Jul 21, 2026
5856cf3
docs(api): annotate MCP error factory as public api
LC43 Jul 21, 2026
b94b655
docs(api): annotate MCP middleware pipeline as public api
LC43 Jul 21, 2026
7be66e8
docs(api): annotate MCP tools namespace as public api
LC43 Jul 21, 2026
c189985
docs(api): annotate MCP abilities namespace as public api
LC43 Jul 21, 2026
dbc615a
docs(api): annotate MCP cache rate audit validation as public api
LC43 Jul 21, 2026
ef878fe
docs(api): annotate Plugin infrastructure as public api
LC43 Jul 21, 2026
a597bf2
docs(api): annotate Container infrastructure as public api
LC43 Jul 21, 2026
ec7d2c3
docs(api): annotate Service namespace as public api
LC43 Jul 21, 2026
20a1865
docs(api): annotate Services Assets namespace as public api
LC43 Jul 21, 2026
7000239
docs(api): annotate admin Features as public api
LC43 Jul 21, 2026
f43df37
docs(api): annotate MCP Meta Settings Features as public api
LC43 Jul 21, 2026
fe7d943
docs(api): add stub method for test compatibility
LC43 Jul 21, 2026
5118c2c
docs(readme): update links to docs site
LC43 Jul 21, 2026
83bb788
docs(tracking): update roadmap with docs site progress
LC43 Jul 21, 2026
55f8b0d
test(mcp): add middleware pipeline tests
LC43 Jul 21, 2026
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
71 changes: 71 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Docs

on:
push:
branches: [main]
paths:
- 'src/**'
- 'docs/**'
- 'bin/**'
- 'phpdoc.dist.xml'
- 'package.json'
workflow_dispatch:

concurrency:
group: pages
cancel-in-progress: true

jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-php@v4
with:
php-version: 8.2

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install phpDocumentor
run: |
wget -q https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.10.0/phpDocumentor.phar
chmod +x phpDocumentor.phar

- name: Install PHP dependencies
run: composer install --no-interaction --no-progress

- name: Generate API docs
run: php phpDocumentor.phar -c phpdoc.dist.xml

- name: Generate MCP docs
run: composer docs:mcp

- name: Install Node dependencies
run: npm ci

- name: Build VitePress site
run: npm run docs:build

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# dev
vendor/
node_modules/

# docs
docs/public/api/
docs/.vitepress/dist/
build/phpdoc-cache/

# editor/OS files
.DS_Store
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Saltus Framework helps you develop WordPress plugins that are based on Custom Po

We built it to make things easier and faster for developers with different skills. Add metaboxes, settings pages and other enhancements with just a few lines of code.

Visit saltus.dev for more information.
Visit [saltus.dev](https://saltus.dev) for more information. Full documentation is available at [docs.saltus.dev](https://docs.saltus.dev).

## Version

Expand Down Expand Up @@ -42,7 +42,7 @@ composer require saltus/framework

### Demo

Refer to the [Framework Demo](https://github.com/SaltusDev/framework-demo) for a complete plugin example and to the [Wiki](https://github.com/SaltusDev/saltus-framework/wiki) for complete documentation.
Refer to the [Framework Demo](https://github.com/SaltusDev/framework-demo) for a complete plugin example and to the [documentation site](https://docs.saltus.dev) for complete documentation.


Once the framework is installed and Composer's autoloader is loaded by your plugin, you can initialize it the following way:
Expand Down Expand Up @@ -187,7 +187,7 @@ Includes support for [github-updater](https://github.com/afragen/github-updater)

Saltus Framework exposes its AI-facing tool surface through the WordPress-native MCP/Abilities API. Native WordPress MCP clients can discover and call the `saltus/*` abilities directly from the active plugin.

For full documentation, see [docs/MCP.md](docs/MCP.md). For client integration guidance, see [docs/MCP-CLIENTS.md](docs/MCP-CLIENTS.md). These pages are source material for the future Saltus MCP documentation site.
For full documentation, see [docs/MCP.md](docs/MCP.md) or the [MCP section](https://docs.saltus.dev/mcp/) of the documentation site. For client integration guidance, see [docs/MCP-CLIENTS.md](docs/MCP-CLIENTS.md) or the [client guide](https://docs.saltus.dev/mcp/clients).

### Quick Start

Expand Down
6 changes: 6 additions & 0 deletions bin/generate-mcp-docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
$root = dirname( __DIR__ );
require_once $root . '/vendor/autoload.php';

if ( ! function_exists( 'apply_filters' ) ) {
function apply_filters( string $hook_name, $value, ...$args ) {
return $value;
}
}

if ( ! class_exists( 'WP_REST_Request' ) ) {
class WP_REST_Request {
private string $method;
Expand Down
16 changes: 16 additions & 0 deletions bin/generate-wpcli-docs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env php
<?php
/**
* Generate WP-CLI command documentation from command class metadata.
*
* This script uses Reflection to introspect src/Features/WpCli/Commands/*.php
* classes and generates Markdown command reference tables, parallel to
* bin/generate-mcp-docs.php.
*
* Run with: composer docs:wpcli
*/

declare( strict_types=1 );

echo "WP-CLI doc generation not yet implemented.\n";
echo "Run after Phase 5B (WP-CLI tools) is implemented.\n";
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@
"test:phpstan": "./vendor/bin/phpstan analyse --memory-limit=2G",
"test:phpcs": "./vendor/bin/phpcs --standard=phpcs.xml",
"fix:phpcbf": "./vendor/bin/phpcbf --standard=phpcs.xml",
"docs:mcp": "php bin/generate-mcp-docs.php"
"docs:mcp": "php bin/generate-mcp-docs.php",
"docs:api": "php phpDocumentor.phar -c phpdoc.dist.xml",
"docs:wpcli": "php bin/generate-wpcli-docs.php",
"docs:all": [
"@docs:mcp",
"@docs:api"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
89 changes: 89 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { defineConfig } from 'vitepress'

export default defineConfig({
title: 'Saltus Framework',
description: 'WordPress plugin development framework for Custom Post Types',
lang: 'en-US',
base: '/',

ignoreDeadLinks: [
/^\/roadmap/,
/^\/current/,
],

head: [
['link', { rel: 'icon', href: '/favicon.ico' }],
],

themeConfig: {
logo: '/logo.png',

nav: [
{ text: 'Getting Started', link: '/getting-started' },
{
text: 'Guides',
items: [
{ text: 'Features', link: '/guides/features' },
{ text: 'Architecture', link: '/guides/architecture' },
{ text: 'Build & Setup', link: '/guides/build' },
],
},
{
text: 'MCP/Abilities',
link: '/mcp/index',
},
{
text: 'API Reference',
link: '/api/index',
},
],

sidebar: {
'/getting-started': [
{
text: 'Getting Started',
items: [
{ text: 'Quick Start', link: '/getting-started' },
],
},
],
'/guides/': [
{
text: 'Guides',
items: [
{ text: 'Features', link: '/guides/features' },
{ text: 'Architecture', link: '/guides/architecture' },
{ text: 'Build & Setup', link: '/guides/build' },
],
},
],
'/mcp/': [
{
text: 'MCP/Abilities',
items: [
{ text: 'Overview', link: '/mcp/index' },
{ text: 'Abilities Reference', link: '/mcp/abilities' },
{ text: 'Client Integration', link: '/mcp/clients' },
],
},
],
},

editLink: {
pattern: 'https://github.com/SaltusDev/saltus-framework/edit/main/docs/:path',
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/SaltusDev/saltus-framework' },
],

footer: {
message: 'GPL-3.0 License',
copyright: 'Copyright Saltus Plugin Framework',
},

search: {
provider: 'local',
},
},
})
13 changes: 10 additions & 3 deletions docs/CURRENT.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Current: Live Working State

## Working
- Phase 5A: Block Editor integration — Blocks feature service, per-CPT block registration, default templates @since 2026-07-06
- Phase 5D: Documentation — fill README placeholders, add model examples @since 2026-07-05
- Phase 5D: Documentation site infrastructure — VitePress + phpDocumentor hybrid, GitHub Actions deploy to docs.saltus.dev, @api annotations on 84 public classes/interfaces, doc content pages @since 2026-07-21
- Phase 5A: Block Editor integration — Blocks feature service, per-CPT block registration, default templates @since 2026-07-08
- Phase 4F/4G: AbilityRuntime middleware pipeline integration — backward-compatible pipeline delegation added to execute() @since 2026-07-21

## Next
- Phase 5D: Fill remaining README placeholders (features, labels, meta, settings tables)
- Phase 5D: Create BLOCKS.md, WPCLI.md, FRONTEND.md content pages
- Phase 5D: Create bin/generate-wpcli-docs.php doc generator
- Phase 5B: WP-CLI tools — 7 grouped command classes mapping every MCP tool
- Phase 5C: Frontend rendering — shortcodes, templates, meta field exposure
- Phase 5D: New doc files (BLOCKS.md, WPCLI.md, FRONTEND.md, FEATURES.md)

## Blocked
- None

## Recent Changes
- Docs infrastructure: VitePress site scaffolded at `docs/.vitepress/`, phpDocumentor config at `phpdoc.dist.xml`, `.github/workflows/docs.yml` for auto-build + GH Pages deploy to `docs.saltus.dev`, `docs/public/CNAME` for custom domain, 6 doc content pages (getting-started, features, architecture, build, MCP overview, API index), `composer docs:all` script (`docs:mcp` + `docs:api`), @api annotations on 84 public classes/interfaces across all namespaces, README updated with docs.saltus.dev links, ROADMAP.md Phase 5D progress tracked @since 2026-07-21
- AbilityRuntime middleware pipeline integration: backward-compatible `execute_via_pipeline()` delegated from `execute()`, `execute_legacy()` preserved as fallback, optional `MiddlewarePipeline` constructor injection — resolves Phase 4F/4G strip-cache/strip-rate-limit items @since 2026-07-21
- Code review feedback: replaced wp_die with RuntimeException in single_export_query to avoid HTML death pages in REST/MCP contexts; added catch clause in export_post to return structured WP_Error; replaced unsafe property_exists with get_object_vars in ModelRestPolicy to avoid fatal errors on non-public properties; added explicit edit_posts permission checks for list_models/get_model/list_meta_fields/get_meta_fields in AbilityDefinitionFactory; changed AuditLogger created_at column from varchar(32) to datetime(3) — 2 commits @since 2026-07-04
- Export query hardening: replaced fragile string-equality check in single_export_query with structural regex detection via is_fake_date_export_query; added wp_die fallback for unrecognized fake-date query shapes; added esc_html__ and wp_die test stubs — 1 commit @since 2026-07-04
- Code review feedback: deferred RestServer instantiation inside rest_api_init to avoid overhead on non-REST requests; replaced wp_next_scheduled/wp_unschedule_event with wp_clear_scheduled_hook in MCP deactivation; gated ensure_table() behind DB version option to avoid unnecessary CREATE TABLE queries on every audit write; added wp_clear_scheduled_hook test stub — 3 commits @since 2026-07-04
Expand Down Expand Up @@ -111,6 +116,8 @@
- MetaController PUT route: `update_item` + `update_item_permissions_check` at `PUT /saltus-framework/v1/meta/{post_type}/{post_id}` with serialized meta merging; UpdateMetaFields MCP tool and MetaControllerTest + UpdateMetaFieldsTest added — 1 commit @since 2026-07-07
- Test suite: 226 tests, 639 assertions (bumped from 214/605 by +12 tests, +34 assertions for new MCP tool, MetaController PUT, and count updates) @since 2026-07-07
- ModelsController: use `check_method` for description property access to prevent PHP 8.2+ dynamic property deprecation notices @since 2026-07-07
- MCP namespace config filterability: added MCPConfig utility class with 3 WordPress filters (saltus/framework/mcp/namespace, saltus/framework/mcp/ability_category, saltus/framework/mcp/ability_prefix); added mcp_route() helper to RestTool base; refactored 21 source files from hardcoded strings to MCPConfig calls; added MCPConfigTest with 13 test cases — 6 commits, 236 tests, 655 assertions @since 2026-07-08
- MCP/REST capability gating refactored: added get_config() to Model interface; added McpPolicy class with 14 test cases for MCP-specific mcp_tools/show_in_mcp gating; refactored ModelRestPolicy from saltus_rest array to per-feature config-section model; updated REST controller error hints; updated all existing tests for new config-section pattern — 7 commits, 250 tests, 669 assertions @since 2026-07-08

## Known Issues
- `composer test` passes; Composer still prints a dependency deprecation notice from `justinrainbow/json-schema` under PHP 8.5.4.
Expand Down
21 changes: 20 additions & 1 deletion docs/MCP-ABILITIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- This file is auto-generated by `composer docs:mcp`. Do not edit by hand. -->

Saltus Framework exposes 17 WordPress-native MCP/Abilities tools.
Saltus Framework exposes 18 WordPress-native MCP/Abilities tools.

| Tool | Ability | REST request | Description |
|------|---------|--------------|-------------|
Expand All @@ -21,6 +21,7 @@ Saltus Framework exposes 17 WordPress-native MCP/Abilities tools.
| `list_posts` | `saltus/list-posts` | `GET /wp/v2/posts` | Query posts from a Custom Post Type with optional filters |
| `list_terms` | `saltus/list-terms` | `GET /wp/v2/{taxonomy_rest_base}` | List terms from a taxonomy (categories, tags, or custom taxonomies) |
| `reorder_posts` | `saltus/reorder-posts` | `POST /saltus-framework/v1/reorder` | Reorder multiple posts by updating their menu_order values in a single batch operation |
| `update_meta_fields` | `saltus/update-meta-fields` | `PUT /saltus-framework/v1/meta/{post_type}/123` | Update meta fields for a specific post of a registered Saltus post type |
| `update_post` | `saltus/update-post` | `PUT /wp/v2/posts/123` | Update an existing post's fields and meta data |
| `update_settings` | `saltus/update-settings` | `PUT /saltus-framework/v1/settings/{post_type}` | Update the Saltus Framework settings for a specific post type |

Expand Down Expand Up @@ -284,6 +285,24 @@ Reorder multiple posts by updating their menu_order values in a single batch ope
|-----------|------|----------|---------|-------------|
| `items` | `array` | yes | | Array of objects with "id" (post ID) and "menu_order" (integer position) |

## `update_meta_fields`

Update meta fields for a specific post of a registered Saltus post type

- Ability: `saltus/update-meta-fields`
- REST request: `PUT /saltus-framework/v1/meta/{post_type}/123`
- REST capability: `meta (post_type)`
- Cacheable: `no`
- Cache TTL: `n/a`

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `post_id` | `number` | yes | | The post ID to update meta fields for |
| `post_type` | `string` | yes | | The post type slug |
| `meta` | `object` | yes | | Meta fields to update as key-value pairs |

## `update_post`

Update an existing post's fields and meta data
Expand Down
Loading
Loading