@wp-operations/wp-ops 0.2.0 → 0.3.1
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/README.md +30 -27
- package/bin/wp-app.js +2 -0
- package/bin/wp-code.js +2 -0
- package/bin/wp-ide.js +2 -0
- package/package.json +12 -3
- package/src/commands/platform.js +16 -2
- package/src/commands/sandbox.js +3 -3
- package/src/main.js +10 -4
- package/wp-operations/CHANGELOG.md +14 -0
- package/wp-operations/README.md +39 -0
- package/wp-operations/agents/builder/AGENT.md +15 -0
- package/wp-operations/assets/admin.css +631 -0
- package/wp-operations/assets/admin.js +614 -0
- package/wp-operations/assets/app/app.css +1 -0
- package/wp-operations/assets/app/app.js +70 -0
- package/wp-operations/assets/app/fonts/inter-medium.woff +0 -0
- package/wp-operations/assets/app/fonts/inter-regular.woff +0 -0
- package/wp-operations/assets/app/fonts/inter-semibold.woff +0 -0
- package/wp-operations/assets/app/login.css +42 -0
- package/wp-operations/assets/brand/icon.svg +20 -0
- package/wp-operations/assets/brand/mark.svg +19 -0
- package/wp-operations/assets/editors/audiobook.css +311 -0
- package/wp-operations/assets/editors/audiofile.css +286 -0
- package/wp-operations/assets/editors/course.css +701 -0
- package/wp-operations/assets/editors/course.js +698 -0
- package/wp-operations/assets/editors/faq.css +258 -0
- package/wp-operations/assets/editors/faq.js +196 -0
- package/wp-operations/assets/editors/interactive.css +220 -0
- package/wp-operations/assets/editors/interactive.js +378 -0
- package/wp-operations/assets/editors/media-sources.css +3 -0
- package/wp-operations/assets/editors/media-sources.js +40 -0
- package/wp-operations/assets/editors/open-media.css +114 -0
- package/wp-operations/assets/editors/open-media.js +182 -0
- package/wp-operations/assets/editors/thumbnails.css +335 -0
- package/wp-operations/assets/editors/thumbnails.js +447 -0
- package/wp-operations/assets/editors/translator.css +818 -0
- package/wp-operations/functions.php +24 -0
- package/wp-operations/index.php +14 -0
- package/wp-operations/platform.json +1836 -0
- package/wp-operations/skills/ai-development-guardrails/SKILL.md +49 -0
- package/wp-operations/skills/gutenberg-reference/SKILL.md +45 -0
- package/wp-operations/skills/js-tooling-for-themes/SKILL.md +51 -0
- package/wp-operations/skills/tailwind-for-wp/SKILL.md +62 -0
- package/wp-operations/skills/wp-clean-classic-themes/SKILL.md +112 -0
- package/wp-operations/skills/wp-psr4-plugins/SKILL.md +2043 -0
- package/wp-operations/skills/wp-security/SKILL.md +90 -0
- package/wp-operations/src/Admin.php +78 -0
- package/wp-operations/src/App/Access.php +57 -0
- package/wp-operations/src/App/Admin.php +442 -0
- package/wp-operations/src/App/App.php +157 -0
- package/wp-operations/src/App/Apps.php +379 -0
- package/wp-operations/src/App/Bundle.php +111 -0
- package/wp-operations/src/App/Contents.php +676 -0
- package/wp-operations/src/App/Engine.php +554 -0
- package/wp-operations/src/App/Github.php +308 -0
- package/wp-operations/src/App/Module.php +23 -0
- package/wp-operations/src/App/Ops.php +470 -0
- package/wp-operations/src/App/Packages.php +289 -0
- package/wp-operations/src/App/Rest.php +539 -0
- package/wp-operations/src/App/Sandboxes.php +206 -0
- package/wp-operations/src/App/Store.php +104 -0
- package/wp-operations/src/App/Usage.php +268 -0
- package/wp-operations/src/Config.php +249 -0
- package/wp-operations/src/Content/Editor.php +223 -0
- package/wp-operations/src/Content/Fields.php +681 -0
- package/wp-operations/src/Content/Scoring.php +253 -0
- package/wp-operations/src/Content/Structure.php +293 -0
- package/wp-operations/src/Content/Types.php +150 -0
- package/wp-operations/src/Content/Uploads.php +50 -0
- package/wp-operations/src/Editors/AudiobookAuthor.php +61 -0
- package/wp-operations/src/Editors/AudiobookChapters.php +632 -0
- package/wp-operations/src/Editors/AudiobookCover.php +235 -0
- package/wp-operations/src/Editors/Audiofile.php +462 -0
- package/wp-operations/src/Editors/Course.php +784 -0
- package/wp-operations/src/Editors/Ebook.php +242 -0
- package/wp-operations/src/Editors/Editors.php +44 -0
- package/wp-operations/src/Editors/Faq.php +237 -0
- package/wp-operations/src/Editors/Files.php +139 -0
- package/wp-operations/src/Editors/Interactive/Builder.php +103 -0
- package/wp-operations/src/Editors/Interactive/Card.php +76 -0
- package/wp-operations/src/Editors/Interactive/Editor.php +42 -0
- package/wp-operations/src/Editors/Interactive/Field.php +272 -0
- package/wp-operations/src/Editors/Interactive/Map.php +84 -0
- package/wp-operations/src/Editors/Interactive/Models.php +227 -0
- package/wp-operations/src/Editors/Interactive/Report.php +59 -0
- package/wp-operations/src/Editors/Interactive/Save.php +323 -0
- package/wp-operations/src/Editors/Interactive/Scoring.php +244 -0
- package/wp-operations/src/Editors/Interactive/Structure.php +195 -0
- package/wp-operations/src/Editors/Legal.php +235 -0
- package/wp-operations/src/Editors/OpenMedia.php +140 -0
- package/wp-operations/src/Editors/OriginalTitle.php +112 -0
- package/wp-operations/src/Editors/Sources.php +28 -0
- package/wp-operations/src/Editors/Thumbnails/Admin.php +306 -0
- package/wp-operations/src/Editors/Thumbnails/Ajax.php +163 -0
- package/wp-operations/src/Editors/Thumbnails/Box.php +188 -0
- package/wp-operations/src/Editors/Thumbnails/Storage.php +228 -0
- package/wp-operations/src/Editors/Translator/Admin.php +913 -0
- package/wp-operations/src/Editors/Translator/Api.php +63 -0
- package/wp-operations/src/Editors/Translator/Bar.php +83 -0
- package/wp-operations/src/Editors/Translator/Fields.php +273 -0
- package/wp-operations/src/Editors/Translator/Storage.php +131 -0
- package/wp-operations/src/Editors/Translator/Thumbnail.php +215 -0
- package/wp-operations/src/Identity.php +104 -0
- package/wp-operations/src/Languages.php +45 -0
- package/wp-operations/src/Lockdown.php +85 -0
- package/wp-operations/src/Modules/Apps/Admin.php +472 -0
- package/wp-operations/src/Modules/Apps/Api.php +193 -0
- package/wp-operations/src/Modules/Apps/Apps.php +279 -0
- package/wp-operations/src/Modules/Apps/Formatters.php +478 -0
- package/wp-operations/src/Modules/Apps/Schemes.php +248 -0
- package/wp-operations/src/Modules/Apps/Table.php +101 -0
- package/wp-operations/src/Modules/Thumbnails.php +68 -0
- package/wp-operations/src/Modules/Translations.php +133 -0
- package/wp-operations/src/Platform.php +59 -0
- package/wp-operations/src/Setup.php +273 -0
- package/wp-operations/src/Status.php +99 -0
- package/wp-operations/src/Storage/Client.php +168 -0
- package/wp-operations/src/Storage/Offload.php +120 -0
- package/wp-operations/src/Storage/Settings.php +166 -0
- package/wp-operations/src/Storage/Storage.php +35 -0
- package/wp-operations/src/Updates.php +151 -0
- package/wp-operations/style.css +11 -0
package/README.md
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
# @wp-operations/wp-ops
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The wp-operations tool. One install gives you all four commands:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install -g @wp-operations/wp-ops
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
| Command | What it is |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `wp-ops` | Platform repository: init, apps, plugins, composer, sandbox |
|
|
12
|
+
| `wp-app` | Local WordPress / ClassicPress server ([wp-app](../wp-app)) |
|
|
13
|
+
| `wp-ide` | Local browser editor with live preview ([wp-ide](../wp-ide)) |
|
|
14
|
+
| `wp-code` | Coding agent in the terminal ([wp-code](../wp-code)) |
|
|
15
|
+
|
|
16
|
+
Requires Node.js 20.10 or later and git. Composer is needed for plugins. If you installed `@wp-operations/wp-app`, `wp-ide` or `wp-code` globally on their own before, uninstall them first, since wp-ops now provides those commands.
|
|
10
17
|
|
|
11
|
-
##
|
|
18
|
+
## Commands
|
|
12
19
|
|
|
13
20
|
```bash
|
|
14
|
-
wp-ops init my-platform --platform=path/to/wp-operations
|
|
21
|
+
wp-ops init my-platform --platform=path/to/wp-operations # the theme folder, for its platform.json
|
|
15
22
|
cd my-platform
|
|
16
|
-
wp-ops new plugin acme/forms
|
|
23
|
+
wp-ops new plugin acme/forms
|
|
17
24
|
wp-ops new app service-apps shop --server=prod-1 --app-path=/var/www/shop
|
|
18
25
|
wp-ops composer add --apps=service-apps/shop --packages="acme/forms"
|
|
19
26
|
wp-ops apps
|
|
@@ -23,35 +30,31 @@ wp-ops doctor
|
|
|
23
30
|
|
|
24
31
|
| Command | What it does |
|
|
25
32
|
|---|---|
|
|
26
|
-
| `init [dir] [--platform=]` | Creates `.github/platform.json`, the
|
|
27
|
-
| `new app <kind> <slug>` | Creates the app
|
|
28
|
-
| `new plugin <vendor/name>` | Creates `packages/<vendor>/<name>`
|
|
29
|
-
| `apps`, `plugins` |
|
|
30
|
-
| `composer <add\|remove\|update> --apps= --packages=` |
|
|
31
|
-
| `sandbox` |
|
|
32
|
-
| `edit` | Opens
|
|
33
|
-
| `
|
|
33
|
+
| `init [dir] [--platform=]` | Creates `.github/platform.json`, the app manifests, `packages/`, the app folders, `.github/workflows/composer.yml` and `.gitignore`, then runs `git init`. Never overwrites a file. `--platform` copies the theme's `platform.json` to the root. |
|
|
34
|
+
| `new app <kind> <slug>` | Creates the app (composer type `wp-app`) and adds it to the kind's manifest. |
|
|
35
|
+
| `new plugin <vendor/name>` | Creates `packages/<vendor>/<name>` (composer type `psr4-plugin`) with `src/Plugin.php`. |
|
|
36
|
+
| `apps`, `plugins` | Lists apps and plugins, which app uses which plugin, and any problems. |
|
|
37
|
+
| `composer <add\|remove\|update> --apps= --packages=` | Edits the apps' composer.json the same way the platform does and refreshes `composer.lock`. This is what `composer.yml` runs. |
|
|
38
|
+
| `sandbox` | Preview runtime for the platform. See below. |
|
|
39
|
+
| `edit` | Opens wp-ide for this repository. |
|
|
40
|
+
| `start`, `dev`, `build` | Runs one app with wp-app. |
|
|
41
|
+
| `doctor` | Checks the environment and the repository. |
|
|
42
|
+
|
|
43
|
+
Running `wp-ops` with no arguments opens a menu.
|
|
34
44
|
|
|
35
|
-
## Sandbox
|
|
45
|
+
## Sandbox
|
|
36
46
|
|
|
37
47
|
```bash
|
|
38
48
|
SANDBOX_TOKEN=… wp-ops sandbox --port=8080 --url=https://sandbox.example.com --git
|
|
39
49
|
```
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
- **Git mode.** With `--git`, the runtime must be a clone with a remote. Each app is served from its own worktree under `.local/sandbox/`, refreshed on every page load: from `vibe/{slug}` (the AI work branch; change it with `--work-branch`) when that branch exists on the remote, otherwise from the deploy branch (`--branch`, default the remote's default branch). New commits show up when the preview reloads.
|
|
47
|
-
- **Without `--git`.** The runtime serves your working tree as it is.
|
|
48
|
-
- **Memory.** At most `--max` sites (default 3) stay running. The least recently used idle site is stopped and starts again on its next request.
|
|
49
|
-
|
|
50
|
-
`--url` must be the public address the platform loads previews from, because WordPress builds its links from it.
|
|
51
|
-
|
|
52
|
-
## Single app
|
|
51
|
+
- Serves every app at `/{kind}/{slug}/`, each on its own WordPress site.
|
|
52
|
+
- `GET /` is the health check. With `SANDBOX_TOKEN` set, it needs `Authorization: Bearer <token>`; set the same value in the platform under Settings → Operations → Sandboxes.
|
|
53
|
+
- The platform shows previews in an iframe: `--frame-ancestors` sets who may do that (default `*`; use the platform's address in production).
|
|
54
|
+
- With `--git`, each app follows `platform/{slug}` (the AI work branch) when it exists on the remote, otherwise the deploy branch (`--branch`). New commits show on the next reload. Without `--git`, it serves your working tree.
|
|
55
|
+
- At most `--max` sites (default 3) run at once.
|
|
53
56
|
|
|
54
|
-
`
|
|
57
|
+
`--url` must be the public address the platform loads previews from.
|
|
55
58
|
|
|
56
59
|
## License
|
|
57
60
|
|
package/bin/wp-app.js
ADDED
package/bin/wp-code.js
ADDED
package/bin/wp-ide.js
ADDED
package/package.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-operations/wp-ops",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "The wp-operations tool. One install gives the platform and wp-ops, wp-app, wp-ide and wp-code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"wp-ops": "cli.js"
|
|
8
|
+
"wp-ops": "cli.js",
|
|
9
|
+
"wp-app": "bin/wp-app.js",
|
|
10
|
+
"wp-ide": "bin/wp-ide.js",
|
|
11
|
+
"wp-code": "bin/wp-code.js"
|
|
9
12
|
},
|
|
10
13
|
"files": [
|
|
11
14
|
"cli.js",
|
|
15
|
+
"bin",
|
|
12
16
|
"src",
|
|
17
|
+
"wp-operations",
|
|
13
18
|
"LICENSE",
|
|
14
19
|
"README.md"
|
|
15
20
|
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prepublishOnly": "node scripts/bundle-theme.js"
|
|
23
|
+
},
|
|
16
24
|
"license": "GPL-2.0-or-later",
|
|
17
25
|
"author": "de-er-kid",
|
|
18
26
|
"repository": {
|
|
@@ -31,6 +39,7 @@
|
|
|
31
39
|
"dependencies": {
|
|
32
40
|
"@clack/prompts": "0.7.0",
|
|
33
41
|
"@wp-operations/wp-app": "^0.4.1",
|
|
42
|
+
"@wp-operations/wp-code": "^0.1.1",
|
|
34
43
|
"@wp-operations/wp-ide": "^0.3.0",
|
|
35
44
|
"picocolors": "1.1.1"
|
|
36
45
|
},
|
package/src/commands/platform.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { execFileSync, spawnSync } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
4
5
|
import pc from 'picocolors';
|
|
5
6
|
import { ide } from '../deps.js';
|
|
6
7
|
import { UsageError } from '../args.js';
|
|
@@ -69,6 +70,7 @@ export async function init({ dir = process.cwd(), platform, version, log = conso
|
|
|
69
70
|
writeNew(path.join(root, '.github', 'workflows', 'composer.yml'), composerWorkflow(version), created);
|
|
70
71
|
writeNew(path.join(root, '.gitignore'), GITIGNORE, created);
|
|
71
72
|
|
|
73
|
+
platform = platform || bundledPlatform();
|
|
72
74
|
if (platform) {
|
|
73
75
|
const source = path.resolve(platform);
|
|
74
76
|
const file = fs.existsSync(source) && fs.statSync(source).isDirectory() ? path.join(source, 'platform.json') : source;
|
|
@@ -89,12 +91,24 @@ export async function init({ dir = process.cwd(), platform, version, log = conso
|
|
|
89
91
|
if (gitInit) log(` ${pc.green('+')} git repository (branch main)`);
|
|
90
92
|
if (!created.length && !gitInit) log(' Already a platform repository; nothing to add.');
|
|
91
93
|
if (!fs.existsSync(path.join(root, 'platform.json'))) {
|
|
92
|
-
log(pc.yellow(`\n platform.json is missing at the root.
|
|
94
|
+
log(pc.yellow(`\n platform.json is missing at the root. Run: wp-ops init --platform=<path to the theme>`));
|
|
93
95
|
}
|
|
94
|
-
log(pc.
|
|
96
|
+
log(`\n Next: ${pc.bold(`cd ${path.relative(process.cwd(), root) || '.'}`)} and ${pc.bold('wp-ops platform')} to run the platform locally.`);
|
|
95
97
|
return { root, created, gitInit };
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
/**
|
|
101
|
+
* The platform theme shipped inside this package (packages/wp-ops/wp-operations),
|
|
102
|
+
* or the repository's theme/ folder when running from the monorepo.
|
|
103
|
+
*/
|
|
104
|
+
export function bundledPlatform() {
|
|
105
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
106
|
+
for (const dir of [path.resolve(here, '..', '..', 'wp-operations'), path.resolve(here, '..', '..', '..', '..', 'theme')]) {
|
|
107
|
+
if (fs.existsSync(path.join(dir, 'style.css')) && fs.existsSync(path.join(dir, 'platform.json'))) return dir;
|
|
108
|
+
}
|
|
109
|
+
return '';
|
|
110
|
+
}
|
|
111
|
+
|
|
98
112
|
function composerName(value) {
|
|
99
113
|
return value.toLowerCase().replace(/[^a-z0-9_.-]+/g, '-').replace(/^[-_.]+|[-_.]+$/g, '');
|
|
100
114
|
}
|
package/src/commands/sandbox.js
CHANGED
|
@@ -74,11 +74,11 @@ function sendJson(res, status, body) {
|
|
|
74
74
|
* The sandbox runtime the platform theme leases: one HTTP server that
|
|
75
75
|
* answers health checks at --health (Bearer token optional) and serves
|
|
76
76
|
* every app of the platform repository at /{kind}/{slug}/ on its own
|
|
77
|
-
* wp-app WordPress site,
|
|
77
|
+
* wp-app WordPress site, which the platform can show in an iframe.
|
|
78
78
|
*
|
|
79
79
|
* Without --git it serves the working tree as it is. With --git it serves
|
|
80
80
|
* each app from its own worktree, refreshed from the remote on every page
|
|
81
|
-
* load: the app's work branch (--work-branch, default
|
|
81
|
+
* load: the app's work branch (--work-branch, default platform/{slug}) when it
|
|
82
82
|
* exists, else the deploy branch.
|
|
83
83
|
*/
|
|
84
84
|
export async function sandbox(options) {
|
|
@@ -96,7 +96,7 @@ export async function sandbox(options) {
|
|
|
96
96
|
const max = Math.max(1, Number(options.max ?? 3));
|
|
97
97
|
const useGit = Boolean(options.git);
|
|
98
98
|
const remote = options.remote || 'origin';
|
|
99
|
-
const workBranch = options.workBranch === false ? '' : String(options.workBranch || '
|
|
99
|
+
const workBranch = options.workBranch === false ? '' : String(options.workBranch || 'platform/{slug}');
|
|
100
100
|
|
|
101
101
|
readLayout(root);
|
|
102
102
|
if (!process.env.WP_APP_HOME) useLocalData(root);
|
package/src/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { parseArgs, UsageError } from './args.js';
|
|
|
6
6
|
import { startApp } from './commands/start.js';
|
|
7
7
|
import { buildAll } from './commands/build.js';
|
|
8
8
|
import { doctor } from './commands/doctor.js';
|
|
9
|
-
import { apps, composer, init, newApp, newPlugin, platformRoot, plugins } from './commands/platform.js';
|
|
9
|
+
import { apps, bundledPlatform, composer, init, newApp, newPlugin, platformRoot, plugins } from './commands/platform.js';
|
|
10
10
|
import { sandbox } from './commands/sandbox.js';
|
|
11
11
|
import { tui } from './tui.js';
|
|
12
12
|
|
|
@@ -19,15 +19,15 @@ Usage:
|
|
|
19
19
|
wp-ops interactive menu
|
|
20
20
|
|
|
21
21
|
Platform repository:
|
|
22
|
-
wp-ops init [dir]
|
|
23
|
-
|
|
22
|
+
wp-ops init [dir] lay out a platform repository and git init it
|
|
23
|
+
wp-ops platform [--port=] run the wp-operations platform locally (admin / password)
|
|
24
24
|
wp-ops apps list apps (<kind>/<slug>) and their deploy targets
|
|
25
25
|
wp-ops plugins list plugins and the apps that use them
|
|
26
26
|
wp-ops new app <kind> <slug> [--server= --app-path= --theme-slug=]
|
|
27
27
|
wp-ops new plugin <vendor/name> [--description=]
|
|
28
28
|
wp-ops composer <add|remove|update> --apps=<a,b> --packages="<x y>" [--constraint=*] [--no-lock]
|
|
29
29
|
edit composer.json and refresh composer.lock (what composer.yml runs)
|
|
30
|
-
wp-ops sandbox [--port=8080] [--url=<public url>] [--git] [--branch=] [--work-branch=
|
|
30
|
+
wp-ops sandbox [--port=8080] [--url=<public url>] [--git] [--branch=] [--work-branch=platform/{slug}]
|
|
31
31
|
[--health=/] [--token-env=SANDBOX_TOKEN] [--frame-ancestors="*"] [--max=3] [--php=] [--wp=]
|
|
32
32
|
serve every app at /{kind}/{slug}/ for the platform's previews
|
|
33
33
|
wp-ops edit [--port=4500] [--preview=<sandbox url>]
|
|
@@ -61,6 +61,12 @@ async function run() {
|
|
|
61
61
|
case 'init':
|
|
62
62
|
await init({ dir: positional[0] ?? process.cwd(), platform: options.platform, version: pkg.version });
|
|
63
63
|
return;
|
|
64
|
+
case 'platform': {
|
|
65
|
+
const theme = bundledPlatform();
|
|
66
|
+
if (!theme) throw new UsageError('The platform theme is missing from this wp-ops install. Reinstall: npm install -g @wp-operations/wp-ops');
|
|
67
|
+
startApp({ appDir: theme, flags });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
64
70
|
case 'apps':
|
|
65
71
|
await apps({ root: await platformRoot() });
|
|
66
72
|
return;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- The theme now lives in the wp-operations repository and updates itself from its releases, with this changelog in Dashboard → Updates.
|
|
6
|
+
- Skills and agents ship with the theme and appear in CMS → Skills and CMS → Agents.
|
|
7
|
+
- The AI work branch is now `platform/{slug}` (was `vibe/{slug}`). Saved settings, options and user data move over on their own.
|
|
8
|
+
- The platform's settings in platform.json are under `app` (was `vibe`), and its REST API is `platform/v1`.
|
|
9
|
+
- Sign-in screen: shows your Site Title and Site Logo, nothing else.
|
|
10
|
+
- License: GPL-2.0-or-later.
|
|
11
|
+
|
|
12
|
+
## 0.0.1
|
|
13
|
+
|
|
14
|
+
- First version: content engine, CMS, app builder and operations.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# wp-operations theme
|
|
2
|
+
|
|
3
|
+
The platform. People with the `prompt` capability use it at the site root (`/`); everyone else signs in at `wp-login.php` as usual. Plugins are switched off: apps get their plugins through composer in the platform repository.
|
|
4
|
+
|
|
5
|
+
Requires WordPress 6.4+ and PHP 8.0+ (with sodium, standard in PHP 8).
|
|
6
|
+
|
|
7
|
+
## wp-config.php
|
|
8
|
+
|
|
9
|
+
Add only what you use. No key, token or secret is ever stored in the database.
|
|
10
|
+
|
|
11
|
+
```php
|
|
12
|
+
define( 'PLATFORM_GITHUB_TOKEN', 'github_pat_…' ); // fine-grained token on the platform repository: Contents, Actions, Secrets, Environments (read/write)
|
|
13
|
+
define( 'PLATFORM_OPENAI_KEY', 'sk-…' ); // one constant per AI model; you choose its name in Settings → AI Models
|
|
14
|
+
define( 'PLATFORM_SANDBOX_TOKEN', '…' ); // optional, per sandbox (same value as SANDBOX_TOKEN for wp-ops sandbox)
|
|
15
|
+
define( 'PLATFORM_STORAGE_BUCKET', '…' ); // optional S3/R2 storage: PLATFORM_STORAGE_ENDPOINT, _BUCKET, _ACCESS_KEY, _SECRET_KEY, _PUBLIC_URL
|
|
16
|
+
define( 'PLATFORM_CONFIG', '/path/to/platform.json' ); // optional: use another platform.json than the theme's
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Settings
|
|
20
|
+
|
|
21
|
+
- **Settings → Operations:** the platform repository, app folders, secrets, workflows and sandboxes.
|
|
22
|
+
- **Settings → AI Models:** models for Build, Plan and Chat, image models, and the work branch (default `platform/{slug}`).
|
|
23
|
+
- **Users → Prompt Users:** who can use the platform, and monthly credits.
|
|
24
|
+
|
|
25
|
+
## platform.json
|
|
26
|
+
|
|
27
|
+
Content types, fields, languages, the admin screens, the platform's look (`app.theme.colors`) and its usage limits. The platform repository keeps a copy at its root (`wp-ops init --platform=<this folder>`).
|
|
28
|
+
|
|
29
|
+
## Skills and agents
|
|
30
|
+
|
|
31
|
+
`skills/<name>/SKILL.md` and `agents/<name>/AGENT.md` ship with the theme and appear in the platform under CMS → Skills and CMS → Agents. Each theme update refreshes them, except the ones you edited there. Skills you add in the CMS are yours and are never touched.
|
|
32
|
+
|
|
33
|
+
## Updates
|
|
34
|
+
|
|
35
|
+
New versions appear in Dashboard → Updates, with the changelog ([CHANGELOG.md](CHANGELOG.md)). They come from the `theme-v*` releases of [wordpress-operations/wordpress-operations](https://github.com/wordpress-operations/wordpress-operations/releases).
|
|
36
|
+
|
|
37
|
+
## Building the UI
|
|
38
|
+
|
|
39
|
+
The platform UI source is in `ui/`. `npm install && npm run build` inside `ui/` writes `assets/app/`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Builder
|
|
3
|
+
description: Builds and changes apps in the platform repository the way this platform expects.
|
|
4
|
+
role: builder
|
|
5
|
+
skills:
|
|
6
|
+
- ai-development-guardrails
|
|
7
|
+
- wp-security
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You change one app in the platform repository at a time.
|
|
11
|
+
|
|
12
|
+
- Themes are classic WordPress themes. No blocks, no theme.json styling, no Full Site Editing.
|
|
13
|
+
- Backend code belongs in plugins under `packages/<vendor>/<name>` (composer type `psr4-plugin`), written to the `wp-psr4-plugins` skill. Apps get plugins through composer, never by copying code into the app.
|
|
14
|
+
- Every request handler follows capability, nonce, sanitize, escape.
|
|
15
|
+
- Keep to the app's existing structure, names and style. Change only what the request needs.
|