@wp-operations/wp-ops 0.3.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/package.json +6 -2
- package/src/commands/platform.js +16 -2
- package/src/main.js +9 -3
- 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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-operations/wp-ops",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "The wp-operations tool. One install gives wp-ops, wp-app, wp-ide and wp-code.",
|
|
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": {
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
"cli.js",
|
|
15
15
|
"bin",
|
|
16
16
|
"src",
|
|
17
|
+
"wp-operations",
|
|
17
18
|
"LICENSE",
|
|
18
19
|
"README.md"
|
|
19
20
|
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prepublishOnly": "node scripts/bundle-theme.js"
|
|
23
|
+
},
|
|
20
24
|
"license": "GPL-2.0-or-later",
|
|
21
25
|
"author": "de-er-kid",
|
|
22
26
|
"repository": {
|
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/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,8 +19,8 @@ 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=]
|
|
@@ -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.
|