hostinger-api-mcp 6.1.0 → 6.3.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 +15 -0
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/skills/headless/SKILL.md +50 -1
- package/skills/headless/VERSION +3 -3
- package/skills/headless/check-findings.mjs +139 -0
- package/skills/headless/push-content.mjs +8 -1
- package/skills/headless/run-log.mjs +43 -0
- package/skills/headless/steps/03-provision/ecommerce/SKILL.md +4 -9
- package/skills/headless/steps/03-provision/pocketbase/SKILL.md +8 -10
- package/skills/headless/steps/03-provision/wordpress/SKILL.md +6 -8
- package/skills/headless/steps/04-content-model/pocketbase/SKILL.md +3 -2
- package/skills/headless/steps/04-content-model/wordpress/SKILL.md +2 -1
- package/skills/headless/steps/06-frontend/SKILL.md +67 -6
- package/skills/headless/steps/06-frontend/visual-check.md +43 -0
- package/skills/headless/steps/06-frontend/visual-recheck.md +33 -0
- package/skills/headless/steps/07-validate/SKILL.md +15 -5
- package/skills/headless/steps/08-deploy/SKILL.md +14 -14
- package/skills/headless/steps/09-done/SKILL.md +5 -2
- package/src/core/skills.js +57 -36
- package/src/core/skills.ts +57 -36
- package/src/servers/agency-hosting.js +1 -1
- package/src/servers/agency-hosting.ts +1 -1
- package/src/servers/agent-readiness.js +1 -1
- package/src/servers/agent-readiness.ts +1 -1
- package/src/servers/all.js +1 -1
- package/src/servers/all.ts +1 -1
- package/src/servers/billing.js +1 -1
- package/src/servers/billing.ts +1 -1
- package/src/servers/dns.js +1 -1
- package/src/servers/dns.ts +1 -1
- package/src/servers/domains.js +1 -1
- package/src/servers/domains.ts +1 -1
- package/src/servers/ecommerce.js +1 -1
- package/src/servers/ecommerce.ts +1 -1
- package/src/servers/gpu.js +1 -1
- package/src/servers/gpu.ts +1 -1
- package/src/servers/hosting.js +1 -1
- package/src/servers/hosting.ts +1 -1
- package/src/servers/mail.js +1 -1
- package/src/servers/mail.ts +1 -1
- package/src/servers/reach.js +1 -1
- package/src/servers/reach.ts +1 -1
- package/src/servers/vps.js +1 -1
- package/src/servers/vps.ts +1 -1
- package/src/servers/wordpress.js +1 -1
- package/src/servers/wordpress.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ Generated at release time from the diff between the previous and current
|
|
|
4
4
|
build. Tool changes are listed individually; everything else is summarised
|
|
5
5
|
by area.
|
|
6
6
|
|
|
7
|
+
## v6.3.0 — 2026-11-27
|
|
8
|
+
|
|
9
|
+
### Also in this release
|
|
10
|
+
|
|
11
|
+
- Bundled agent skills: 7 files
|
|
12
|
+
- Other files: `src/core/skills.js`, `src/core/skills.ts`
|
|
13
|
+
|
|
14
|
+
## v6.2.0 — 2026-11-27
|
|
15
|
+
|
|
16
|
+
### Also in this release
|
|
17
|
+
|
|
18
|
+
- Dependencies: `package-lock.json`
|
|
19
|
+
- Bundled agent skills: 11 files
|
|
20
|
+
- Other files: `src/core/skills.js`, `src/core/skills.ts`
|
|
21
|
+
|
|
7
22
|
## v6.1.0 — 2026-11-26
|
|
8
23
|
|
|
9
24
|
### Also in this release
|
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"url": "https://github.com/hostinger/api-mcp-server",
|
|
18
18
|
"source": "github"
|
|
19
19
|
},
|
|
20
|
-
"version": "6.
|
|
20
|
+
"version": "6.3.0",
|
|
21
21
|
"packages": [
|
|
22
22
|
{
|
|
23
23
|
"registryType": "npm",
|
|
24
24
|
"identifier": "@hostinger/mcp",
|
|
25
|
-
"version": "6.
|
|
25
|
+
"version": "6.3.0",
|
|
26
26
|
"transport": {
|
|
27
27
|
"type": "stdio"
|
|
28
28
|
},
|
package/skills/headless/SKILL.md
CHANGED
|
@@ -50,7 +50,8 @@ Hostinger connector's OAuth token. **This recipe is not a security boundary.**
|
|
|
50
50
|
Work through the stages in the order the table lists them, each reading its recipe and writing its
|
|
51
51
|
artifact into the site workspace `~/.hostinger/<domain>/`. The one exception to the order is content
|
|
52
52
|
prepare (step 4) and design (step 5): with a subagent tool, run them at the same time, as *Content and design at
|
|
53
|
-
the same time* says
|
|
53
|
+
the same time* says, and frontend's visual check (step 6) goes to a fresh subagent, which screenshots
|
|
54
|
+
the site and reports what to fix (`steps/06-frontend/SKILL.md` → *Visual check*).
|
|
54
55
|
|
|
55
56
|
| # | Stage | Skill / source | Writes | Instance? |
|
|
56
57
|
|---|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|---|---|
|
|
@@ -255,6 +256,53 @@ exits 0 with `ok: true` and what it waited for; 1 with `ok: false` when the job
|
|
|
255
256
|
the local Hostinger MCP, with `fallback` naming the connector operation to poll yourself, every ~15 s.
|
|
256
257
|
Never write your own `sleep` loops.
|
|
257
258
|
|
|
259
|
+
### Known Hostinger quirks
|
|
260
|
+
|
|
261
|
+
Hostinger behaviors the steps meet and expect. When one shows up, do what its row says, once; the
|
|
262
|
+
steps name the quirk and point here. A quirk's retry is not a fix (*Stop a fix loop after two fixes*).
|
|
263
|
+
|
|
264
|
+
| Quirk | Symptom | What to do |
|
|
265
|
+
|---|---|---|
|
|
266
|
+
| Install list lags | `wordpress_installations_list` returns `[]` for a few seconds after the setup is `completed` | Retry it briefly before failing |
|
|
267
|
+
| Install URL says http | The WordPress install record's `url` starts with `http://` | Use `https://<domain>/cms` URLs anyway |
|
|
268
|
+
| `jwt-token` 500 that succeeded | `wordpress_installations_jwt-token` returns HTTP 500 | Call it once more before failing |
|
|
269
|
+
| `mcp_url` says http | The `jwt-token` reply's `mcp_url` starts with `http://`, and the WP MCP's `initialize` answers 405 (the https redirect turns the POST into a GET) | `push-content.mjs` switches it to `https://` itself; by hand, use the `https://` URL |
|
|
270
|
+
| Plugin install 500 that succeeded | `wordpress_plugins_install` returns HTTP 500 | Go straight to the poll; never send a second install blindly |
|
|
271
|
+
| Root 403 before the first deploy | `GET https://<domain>/` returns 403 or the Hostinger default page until the frontend is deployed | Expected, not a failure |
|
|
272
|
+
| PocketBase `failed` | `hosting_pocketbase_backend` says `state: failed` | Hostinger retries it on its own after `retry_after_seconds`: wait that long and read again. The data is intact; never delete the backend |
|
|
273
|
+
| PocketBase 503 after idle | The first request after about 5 idle minutes returns 503 | A wake-up: send it again |
|
|
274
|
+
| Ecommerce 402 on payment | `ecommerce_payments_enable-manual-method` returns HTTP 402 (a free account), and checkout later fails with `400 payment_provider_not_configured` | A normal outcome: record `payment_enabled: false`, tell the user in one line that checkout needs a paid Ecommerce plan, and carry on. Never retry |
|
|
275
|
+
| SSL pending | `wait.mjs` returns `ok: true` with `https_pending: true`: a new domain's certificate is still installing, for up to about an hour | The deploy worked: check over `http://`, tell the user HTTPS follows on its own, and don't wait for it |
|
|
276
|
+
| Root 403 after a completed build | The build is `completed` but the root serves 403 (`wait.mjs` says `build settings missing`, or times out on the root) | The deploy call went without its build settings: pass them (`steps/08-deploy/SKILL.md`) and redeploy. This one is a real fix |
|
|
277
|
+
| SSR app hangs | The build is `completed` but an SSR root never answers (`wait.mjs build` `timed_out` on the root) | `hosting_nodejs_restart-application { username, domain }`, no rebuild |
|
|
278
|
+
| Stale root after deploy | The root still serves the previous build right after a `completed` one | Check again after about 30 s |
|
|
279
|
+
|
|
280
|
+
### Stop a fix loop after two fixes
|
|
281
|
+
|
|
282
|
+
Three checks can keep failing while you fix and retry: the Hostinger deploy build (`wait.mjs build`
|
|
283
|
+
says `failed`), deploy verification (`steps/08-deploy/SKILL.md` Step 5), and the content push. When the
|
|
284
|
+
same check fails again after **two real fixes**, stop: no third fix, no further redeploy or push. The
|
|
285
|
+
first attempt isn't a fix, so you stop at its third failure: the first attempt, then one after each fix.
|
|
286
|
+
|
|
287
|
+
A real fix is a change to the source, config or deploy call aimed at that failure. The retry or
|
|
288
|
+
workaround of a *Known Hostinger quirks* row doesn't count, and neither does running `wait.mjs` again
|
|
289
|
+
after `timed_out`. The local `npm run build` while you write the frontend isn't one of these checks.
|
|
290
|
+
|
|
291
|
+
When you stop:
|
|
292
|
+
|
|
293
|
+
1. End the stage `failed` and log one unresolved `issue` naming both fixes, in one command (add
|
|
294
|
+
`--phase push` on the `stage-end` for the content push):
|
|
295
|
+
```bash
|
|
296
|
+
node <skill>/run-log.mjs <domain> stage-end <stage> failed --note "<check>: stopped after 2 fixes" && node <skill>/run-log.mjs <domain> event issue '{"stage":"<stage>","symptom":"<what failed>","workaround":"fix 1: <…>; fix 2: <…>","severity":"high","resolved":false}'
|
|
297
|
+
```
|
|
298
|
+
2. Tell the user through the done step's final report, not a summary of your own: read
|
|
299
|
+
`steps/09-done/SKILL.md` now and write the final report it describes (`--outcome failed`). Its
|
|
300
|
+
outcome paragraph names the check that stopped, its *Steps completed* table ends at that stage, and
|
|
301
|
+
the failure with the two fixes you tried is one item of its *Gaps / follow-ups* list: `report
|
|
302
|
+
--outcome failed` prints that item, so copy it as written. Don't ask
|
|
303
|
+
whether to keep trying. If the user asks to, that continues the run as a follow-up (*Follow-ups
|
|
304
|
+
continue the run*).
|
|
305
|
+
|
|
258
306
|
### Local servers: `local-server.mjs`
|
|
259
307
|
|
|
260
308
|
Start every local dev or preview server (frontend's visual check, validate's sign-off preview) through
|
|
@@ -312,6 +360,7 @@ took from it.
|
|
|
312
360
|
| `.pocketbase/credentials.json` | provision (PocketBase) | the backend's superuser email and one-time password; mode `600`, never deployed, never printed |
|
|
313
361
|
| `design.md` (+ `brand/` logo files) | design | chosen design direction: tokens, type, logo, components, per-page composition, accessibility |
|
|
314
362
|
| `src/` | frontend | the website source implementing `design.md`; framework choice is recorded in `state.json → frontend` |
|
|
363
|
+
| `checks/<round>/` | the visual check subagents, frontend's and validate's | the screenshots of each check round, named `<route>-<width>.png` (`home` for `/`, else the path without its leading `/` and with each other `/` as `-`), with `-2`, `-3` … for each further viewport-height section, the subagent's `answer.txt`, which `check-findings.mjs` turns into `issue` events, and any helper scripts the checker wrote |
|
|
315
364
|
| `deploy.json` | deploy | build id, deployed at, live URLs |
|
|
316
365
|
| `servers.json` (+ `servers/<port>.log`) | `local-server.mjs` only | each local dev or preview server a run started: pid, port, command, start time, and whether it was stopped |
|
|
317
366
|
| `events.jsonl` | every stage, via `run-log.mjs` | append-only log of issues, user feedback, skill gaps and wins |
|
package/skills/headless/VERSION
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
version=6.
|
|
2
|
-
commit=
|
|
3
|
-
built=2026-11-
|
|
1
|
+
version=6.3.0
|
|
2
|
+
commit=61ab2b685f66
|
|
3
|
+
built=2026-11-27
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Hostinger Headless visual check findings: turns the check subagents' answers into the run's issue
|
|
3
|
+
// events, one per finding, so the build report counts what the check caught.
|
|
4
|
+
//
|
|
5
|
+
// set -o pipefail; node check-findings.mjs <domain> --stage <frontend|validate> \
|
|
6
|
+
// | while IFS= read -r e; do node run-log.mjs <domain> event issue "$e" || exit 1; done
|
|
7
|
+
//
|
|
8
|
+
// Reads ~/.hostinger/<domain>/checks/<round>/answer.txt for every round written since the current
|
|
9
|
+
// run started, as the subagents saved them. A finding line is `<id> | <defect|polish> | <routes> |
|
|
10
|
+
// <widths> | <what's wrong> | <rule> | <screenshot or file>`, its id `<round>.<n>`; a re-check answers
|
|
11
|
+
// `fixed | <id>` or `open | <id> | …`. A finding is resolved when the latest round that named it
|
|
12
|
+
// answered `fixed`. A finding this run already logged (its id in a `visual check:` issue event) is
|
|
13
|
+
// skipped, so running it again, or again at validate, logs only what is new.
|
|
14
|
+
//
|
|
15
|
+
// stdout is one `issue` event per line (`medium` for a defect, `low` for polish), for run-log.mjs to
|
|
16
|
+
// log: run-log.mjs takes the agent's session from its parent, so it runs from the agent's shell, not
|
|
17
|
+
// from here. stderr lists the unresolved findings and every line it couldn't place. Exit 0 when done;
|
|
18
|
+
// 1 when an answer needs fixing (a line it couldn't place, a status for an unknown id, a round with no
|
|
19
|
+
// answer.txt), after printing the events it could read; 2 when it couldn't run.
|
|
20
|
+
|
|
21
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
22
|
+
import { join } from 'node:path';
|
|
23
|
+
import { workspaceDir } from './workspace.mjs';
|
|
24
|
+
|
|
25
|
+
const STAGES = ['frontend', 'validate'];
|
|
26
|
+
const SEVERITY = { defect: 'medium', polish: 'low' };
|
|
27
|
+
const LOGGED_ID = /^visual check: .* \((\d+\.\d+)\)$/;
|
|
28
|
+
|
|
29
|
+
const fail = (message) => {
|
|
30
|
+
console.error(`check-findings: ${message}`);
|
|
31
|
+
process.exit(2);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function parseArgs(argv) {
|
|
35
|
+
const positional = [];
|
|
36
|
+
const flags = {};
|
|
37
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
38
|
+
if (argv[i].startsWith('--')) {
|
|
39
|
+
const key = argv[i].slice(2);
|
|
40
|
+
const value = argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[(i += 1)] : true;
|
|
41
|
+
flags[key] = value;
|
|
42
|
+
} else positional.push(argv[i]);
|
|
43
|
+
}
|
|
44
|
+
return { positional, flags };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const readJson = (file, fallback) => {
|
|
48
|
+
try {
|
|
49
|
+
return JSON.parse(readFileSync(file, 'utf8'));
|
|
50
|
+
} catch {
|
|
51
|
+
return fallback;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// A line's fields, without the list markers, bold or backticks a model may wrap it in.
|
|
56
|
+
const fields = (line) => line.replace(/^\s*(?:[-*]\s+)?/, '').split('|').map((f) => f.trim().replace(/^[*`]+|[*`]+$/g, ''));
|
|
57
|
+
|
|
58
|
+
const { positional, flags } = parseArgs(process.argv.slice(2));
|
|
59
|
+
const [domain, ...extra] = positional;
|
|
60
|
+
if (extra.length) fail(`unexpected arguments: ${extra.join(' ')}`);
|
|
61
|
+
if (!STAGES.includes(flags.stage)) fail(`--stage must be one of ${STAGES.join(', ')}`);
|
|
62
|
+
let dir;
|
|
63
|
+
try {
|
|
64
|
+
dir = workspaceDir(domain);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
fail(error.message);
|
|
67
|
+
}
|
|
68
|
+
const run = readJson(join(dir, 'run-log.json'), {}).run;
|
|
69
|
+
if (!run?.id || !run.started_at) fail('no run started; run-log.mjs run-start comes first');
|
|
70
|
+
const since = Date.parse(run.started_at);
|
|
71
|
+
const logged = new Set(
|
|
72
|
+
(existsSync(join(dir, 'events.jsonl')) ? readFileSync(join(dir, 'events.jsonl'), 'utf8').split('\n') : [])
|
|
73
|
+
.map((line) => { try { return JSON.parse(line); } catch { return null; } })
|
|
74
|
+
.filter((e) => e?.type === 'issue' && e.run === run.id)
|
|
75
|
+
.map((e) => LOGGED_ID.exec(e.symptom ?? '')?.[1])
|
|
76
|
+
.filter(Boolean),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const checks = join(dir, 'checks');
|
|
80
|
+
// A round whose answer was written before this run started belongs to an earlier build of the domain.
|
|
81
|
+
// Rounds count from 1 on every build, and overwriting a file leaves its folder's mtime alone, so the
|
|
82
|
+
// answer's own mtime decides; the folder's only when the round has no answer.
|
|
83
|
+
const stamp = (round) => {
|
|
84
|
+
const answer = join(checks, round, 'answer.txt');
|
|
85
|
+
return statSync(existsSync(answer) ? answer : join(checks, round)).mtimeMs;
|
|
86
|
+
};
|
|
87
|
+
const rounds = (existsSync(checks) ? readdirSync(checks) : [])
|
|
88
|
+
.filter((d) => /^\d+$/.test(d) && stamp(d) >= since - 1000)
|
|
89
|
+
.map(Number)
|
|
90
|
+
.sort((a, b) => a - b);
|
|
91
|
+
const findings = new Map();
|
|
92
|
+
const problems = [];
|
|
93
|
+
for (const round of rounds) {
|
|
94
|
+
const file = join(checks, String(round), 'answer.txt');
|
|
95
|
+
if (!existsSync(file)) {
|
|
96
|
+
problems.push(`round ${round}: no answer.txt`);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
for (const line of readFileSync(file, 'utf8').split(/\r?\n/)) {
|
|
100
|
+
if (!line.trim()) continue;
|
|
101
|
+
const f = fields(line);
|
|
102
|
+
const kind = f[1]?.toLowerCase();
|
|
103
|
+
if (/^no findings\.?$/i.test(f[0])) continue;
|
|
104
|
+
if (/^can't check/i.test(f[0])) {
|
|
105
|
+
console.error(`round ${round}: ${line.trim()}`);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (/^\d+\.\d+$/.test(f[0]) && SEVERITY[kind] && f.length >= 7) {
|
|
109
|
+
const [id, , routes, widths] = f;
|
|
110
|
+
if (id.split('.')[0] !== String(round) || findings.has(id)) {
|
|
111
|
+
problems.push(`round ${round}: id ${id} isn't a new ${round}.<n> id: ${line.trim()}`);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
// What's wrong may hold a |, so the rule and the path are counted from the end.
|
|
115
|
+
const [rule, where] = f.slice(-2);
|
|
116
|
+
const wrong = f.slice(4, -2).join(' | ');
|
|
117
|
+
const place = routes === '-' ? where : `${routes} at ${widths}`;
|
|
118
|
+
findings.set(id, { id, kind, symptom: `visual check: ${place}: ${wrong} (${id})`, cause: rule, resolved: false });
|
|
119
|
+
} else if (/^(fixed|open)$/i.test(f[0])) {
|
|
120
|
+
const finding = findings.get(f[1]);
|
|
121
|
+
if (finding) finding.resolved = f[0].toLowerCase() === 'fixed';
|
|
122
|
+
else if (!logged.has(f[1])) problems.push(`round ${round}: ${f[0]} for unknown id ${f[1]}: ${line.trim()}`);
|
|
123
|
+
} else {
|
|
124
|
+
problems.push(`round ${round}: not in the answer format: ${line.trim()}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const fresh = [...findings.values()].filter((f) => !logged.has(f.id));
|
|
130
|
+
for (const f of fresh) {
|
|
131
|
+
process.stdout.write(`${JSON.stringify({ stage: flags.stage, symptom: f.symptom, cause: f.cause, severity: SEVERITY[f.kind], resolved: f.resolved })}\n`);
|
|
132
|
+
}
|
|
133
|
+
const open = fresh.filter((f) => !f.resolved);
|
|
134
|
+
console.error(`${fresh.length} findings to log, ${open.length} unresolved${open.map((f) => `\nunresolved ${f.symptom}`).join('')}`);
|
|
135
|
+
if (open.length) console.error('List each unresolved finding under *Gaps / follow-ups* in the final report, with why it wasn\'t fixed.');
|
|
136
|
+
if (problems.length) {
|
|
137
|
+
console.error(`${problems.join('\n')}\nFix these lines in answer.txt to the answer format, as the subagent answered, and run the command again: findings already logged aren't logged twice.`);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
@@ -194,11 +194,18 @@ const restApi = site.urls?.rest_api ?? `https://${domain}/cms/wp-json/wp/v2`;
|
|
|
194
194
|
const storeApi = site.urls?.store_api ?? `https://${domain}/cms/wp-json/wc/store/v1`;
|
|
195
195
|
const store = content.store;
|
|
196
196
|
|
|
197
|
+
// jwt-token has returned the site's mcp_url as http://, and the https redirect turns the POST into a GET (405).
|
|
198
|
+
function overHttps(url) {
|
|
199
|
+
const u = new URL(url);
|
|
200
|
+
if (u.protocol === 'http:' && u.hostname === domain) u.protocol = 'https:';
|
|
201
|
+
return u.href;
|
|
202
|
+
}
|
|
203
|
+
|
|
197
204
|
localMcp = connect('headless-push-content');
|
|
198
205
|
const mint = async () => {
|
|
199
206
|
const { data, error } = await localMcp.execute('wordpress_installations_jwt-token', { username, software });
|
|
200
207
|
if (error || !data?.token) throw new Error(`couldn't mint the installation token: ${error ?? 'no token in the reply'}`);
|
|
201
|
-
return { token: data.token, url: data.mcp_url ?? site.urls?.wp_mcp };
|
|
208
|
+
return { token: data.token, url: overHttps(data.mcp_url ?? site.urls?.wp_mcp) };
|
|
202
209
|
};
|
|
203
210
|
const wp = await openSite(mint).catch((e) => finish(2, { ok: false, error: `couldn't open the site's WP MCP: ${e.message}`, fallback: FALLBACK }));
|
|
204
211
|
|
|
@@ -507,6 +507,9 @@ function buildReport(ws, { outcome, tokens } = {}) {
|
|
|
507
507
|
const endedAt = stillOpen ? now() : lastActivity(run, history, events);
|
|
508
508
|
const stages = history.map((h) => ({ ...h, minutes: minutesBetween(h.started_at, h.ended_at ?? endedAt) }));
|
|
509
509
|
const gaps = [...loggingGaps(stages, run, resolvedOutcome), ...dropped];
|
|
510
|
+
if (resolvedOutcome === 'failed' && !events.some((e) => e.type === 'issue' && !e.resolved)) {
|
|
511
|
+
gaps.push({ stage: stoppedAt(stages, state.stage) ?? 'done', phase: null, problem: 'the run failed but no unresolved issue says what failed; log one with `event issue` ("resolved":false), then run report again' });
|
|
512
|
+
}
|
|
510
513
|
const strip = ({ ts, run: _run, type: _type, ...rest }) => ({ ...rest, logged_at: ts });
|
|
511
514
|
const liveStage = stages.find((s) => s.stage === 'deploy' && s.result?.startsWith('ok'));
|
|
512
515
|
const servers = serversSince(ws.dir, run.started_at);
|
|
@@ -854,6 +857,46 @@ async function report(ws, flags) {
|
|
|
854
857
|
console.log(`report written: ${buildReport(ws, { outcome: flags.outcome, tokens })}`);
|
|
855
858
|
const { id, file } = reportFile(ws);
|
|
856
859
|
console.log(`send it: pass ${file} unchanged to hosting_headless_submit-build-report, then run report-sent ${id} (or report-rejected ${id} on a 422)`);
|
|
860
|
+
const written = readJson(file, {});
|
|
861
|
+
if (written.info?.outcome === 'failed') for (const line of gapsToCopy(written.issues)) console.log(line);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// Agents left to remember the done step's format write their own sections instead, so a failed run
|
|
865
|
+
// prints its required Gaps / follow-ups items as text to copy. Agents log an issue per attempt, so
|
|
866
|
+
// it's one item per stage: the stage's latest symptom, and every distinct fix its issues name.
|
|
867
|
+
function gapsToCopy(issues) {
|
|
868
|
+
const byStage = new Map();
|
|
869
|
+
for (const i of issues.filter((i) => !i.resolved)) byStage.set(i.stage, [...(byStage.get(i.stage) ?? []), i]);
|
|
870
|
+
if (!byStage.size) return [];
|
|
871
|
+
return [
|
|
872
|
+
'Copy into your final report, as written, as items of its *Gaps / follow-ups* list:',
|
|
873
|
+
...[...byStage].map(([stage, open], n) => {
|
|
874
|
+
const tried = distinctFixes(open);
|
|
875
|
+
return `${n + 1}. ${label(stage)}: ${forReport(open.at(-1).symptom)}.${tried.length ? ` Tried: ${tried.join('; ')}.` : ''} Still failing.`;
|
|
876
|
+
}),
|
|
877
|
+
];
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
// An issue's workaround often lists several fixes ("fix 1: …; fix 2: …", as the stop rule logs them),
|
|
881
|
+
// and the stop's issue repeats fixes logged earlier in other words, so split on ';' and keep each fix
|
|
882
|
+
// once, by its number when it has one, in the order and wording first logged.
|
|
883
|
+
function distinctFixes(issues) {
|
|
884
|
+
const fixes = issues.flatMap((i) => String(i.workaround ?? '').split(';')).map((f) => forReport(f)).filter(Boolean);
|
|
885
|
+
const seen = new Map();
|
|
886
|
+
for (const f of fixes) {
|
|
887
|
+
const number = f.match(/^fix\s*(\d+)\b/i)?.[1];
|
|
888
|
+
const key = number ? `fix ${number}` : f.toLowerCase().replace(/\s+/g, ' ');
|
|
889
|
+
if (!seen.has(key)) seen.set(key, f);
|
|
890
|
+
}
|
|
891
|
+
return [...seen.values()];
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// Short, and with anything shaped like a credential masked: the final report never shows secrets.
|
|
895
|
+
const SECRET = /\beyJ[\w-]+\.[\w-]+\.[\w-]+|\b(Bearer|Basic)\s+\S+|\b(password|passwd|token|secret|api[_-]?key|authorization)(["']?\s*[:=]\s*["']?)[^\s"',;]+/gi;
|
|
896
|
+
function forReport(text, max = 240) {
|
|
897
|
+
const masked = String(text).trim().replace(SECRET, (m, scheme, key, sep) => (scheme ? `${scheme} [redacted]` : key ? `${key}${sep}[redacted]` : '[redacted]'));
|
|
898
|
+
const clipped = masked.length > max ? `${masked.slice(0, max - 1)}…` : masked;
|
|
899
|
+
return clipped.trim().replace(/[.\s]+$/, '');
|
|
857
900
|
}
|
|
858
901
|
|
|
859
902
|
// What each command does with the domain's lock: check it (refuse if another live session holds it,
|
|
@@ -89,15 +89,10 @@ A store needs ≥1 shipping zone and ≥1 payment method to check out.
|
|
|
89
89
|
- **Shipping:** `ecommerce_shipping_set-store { store_id, price }` (minor units; 0 = free).
|
|
90
90
|
- **Payment:** `ecommerce_payments_enable-manual-method { store_id, title }`.
|
|
91
91
|
|
|
92
|
-
> **
|
|
93
|
-
>
|
|
94
|
-
>
|
|
95
|
-
>
|
|
96
|
-
> catalog and the storefront still work fully. **Never block, stop, loop or retry the build on this:**
|
|
97
|
-
> - Record `payment_enabled: false` in `site.json` (set `shipping_enabled` as usual).
|
|
98
|
-
> - Tell the user in one line that checkout needs a paid Ecommerce plan, and carry straight on.
|
|
99
|
-
> - Treat the 402 as a normal outcome — don't surface it as a failure or re-attempt the call.
|
|
100
|
-
> - Never ask the user for payment credentials.
|
|
92
|
+
> **Free accounts have no payment method, and therefore no checkout.** On a free account (or any store
|
|
93
|
+
> without a paid Hostinger Ecommerce plan), `enable-manual-method` returns HTTP 402: the *Ecommerce 402
|
|
94
|
+
> on payment* quirk under *Known Hostinger quirks* in the top-level `SKILL.md` says what to do. Set
|
|
95
|
+
> `shipping_enabled` as usual, and never ask the user for payment credentials.
|
|
101
96
|
>
|
|
102
97
|
> Every downstream stage reads `site.json → ecommerce.payment_enabled` and, when it is `false`, skips
|
|
103
98
|
> all checkout wiring and verification (see content-model Step 5, frontend, deploy). A store with
|
|
@@ -119,13 +119,11 @@ it runs at the join.
|
|
|
119
119
|
- Any other message → stop and show it to the user. Never retry a 422 blindly.
|
|
120
120
|
4. **Wait for it.** `state` may be `null` right after creation; that's normal.
|
|
121
121
|
`cd "$HOME" && node <skill>/wait.mjs pocketbase <domain>` returns once `https://<domain>/api/health`
|
|
122
|
-
answers 200 (over `http://` with `https_pending: true
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
a new, empty one. The backend sleeps after about 5 idle minutes, so one 503 on a first request is
|
|
128
|
-
a wake-up.
|
|
122
|
+
answers 200 (over `http://` with `https_pending: true`: the *SSL pending* quirk, so go on). If it
|
|
123
|
+
times out, re-read `hosting_pocketbase_backend`: `failed` is the *PocketBase `failed`* quirk;
|
|
124
|
+
`unregistered` means it's broken → stop and show the user; `missing` means its files are gone →
|
|
125
|
+
point 2 creates a new, empty one. A 503 on a first request is the *PocketBase 503 after idle*
|
|
126
|
+
quirk. The quirks are under *Known Hostinger quirks* in the top-level `SKILL.md`.
|
|
129
127
|
|
|
130
128
|
PocketBase owns `/api` and `/_` on this domain; the app's own server routes use another prefix (e.g.
|
|
131
129
|
`/server`). The owner sets outgoing mail (SMTP), backups and social sign-in in the dashboard: they
|
|
@@ -142,9 +140,9 @@ it in this flow.
|
|
|
142
140
|
| PocketBase answers | `GET https://<domain>/api/health` and `GET https://<domain>/_/` | 200 and 200 |
|
|
143
141
|
| Credentials saved | `~/.hostinger/<domain>/.pocketbase/credentials.json` | present, mode `600`, `domain` matches |
|
|
144
142
|
|
|
145
|
-
`GET https://<domain>/`
|
|
146
|
-
|
|
147
|
-
`/api` and `/_` once it is deployed (Step 8).
|
|
143
|
+
`GET https://<domain>/` serving the default page or 403 is the *root 403 before the first deploy*
|
|
144
|
+
quirk (*Known Hostinger quirks* in the top-level `SKILL.md`). There is **no `/cms`** on this domain;
|
|
145
|
+
the app itself serves every route but `/api` and `/_` once it is deployed (Step 8).
|
|
148
146
|
|
|
149
147
|
If a check fails: retry once after ~30 s; if it still fails, stop and point the user at hPanel.
|
|
150
148
|
|
|
@@ -102,12 +102,10 @@ install WordPress straight into its `/cms` directory. This is the onboarding han
|
|
|
102
102
|
|
|
103
103
|
Notes:
|
|
104
104
|
|
|
105
|
-
- `wordpress_installations_list`
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
- A `jwt-token` HTTP 500 can still have succeeded (a known quirk of the `hostinger-wordpress` MCP):
|
|
110
|
-
call it again before failing.
|
|
105
|
+
- `wordpress_installations_list`'s `domain` filter is a substring match, so exact-match the row.
|
|
106
|
+
- Four quirks can show up here: *Install list lags*, *Install URL says http*, *Root 403 before the
|
|
107
|
+
first deploy* and *`jwt-token` 500 that succeeded*. Each has its one action under *Known Hostinger
|
|
108
|
+
quirks* in the top-level `SKILL.md`.
|
|
111
109
|
- **Never print, log or store the JWT.** It is minted on demand (24 h lifetime) by whichever stage
|
|
112
110
|
needs the per-site WP MCP; only `mcp_url` is recorded.
|
|
113
111
|
|
|
@@ -131,8 +129,8 @@ which plugins you're installing; drop `wordpress-seo` if they say they don't wan
|
|
|
131
129
|
|
|
132
130
|
1. **Install all of them in one call** (management MCP, async):
|
|
133
131
|
`wordpress_plugins_install { username, software: <install_id>, plugins: [<every slug from the table>] }`.
|
|
134
|
-
An HTTP 500
|
|
135
|
-
|
|
132
|
+
An HTTP 500 is the *plugin install 500 that succeeded* quirk (*Known Hostinger quirks* in the
|
|
133
|
+
top-level `SKILL.md`).
|
|
136
134
|
2. **Poll** `wordpress_plugins_list-installed { username, software }` until every slug shows `active`
|
|
137
135
|
(install and activate usually complete together). Activate a slug that is installed but inactive with
|
|
138
136
|
`wordpress_plugins_activate { username, software, plugin: "<slug>" }`.
|
|
@@ -70,8 +70,9 @@ Only once `provision.status == "completed"`.
|
|
|
70
70
|
node <here>/scripts/pb-apply-schema.mjs ~/.hostinger/<domain>/pocketbase/schema.json ~/.hostinger/<domain>/.pocketbase/credentials.json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
Fix every reported problem and run it again until it prints `DONE
|
|
74
|
-
|
|
73
|
+
Fix every reported problem and run it again until it prints `DONE`; when it still fails after two real
|
|
74
|
+
fixes, stop as *Stop a fix loop after two fixes* in the top-level `SKILL.md` says. It is idempotent: it
|
|
75
|
+
never deletes fields or data, adds `created` and `updated` timestamps, inserts `seed` records into empty
|
|
75
76
|
collections and merges `rateLimits`. Re-run it after every schema change; a schema change needs no
|
|
76
77
|
redeploy.
|
|
77
78
|
|
|
@@ -96,7 +96,8 @@ stderr; stdout is one JSON line with `counts`, `verify` and `ids`.
|
|
|
96
96
|
| `1` with `failed` | Those items failed; the rest is in | Fix the cause the `error` names and re-run. If the same item fails twice, create just that item with [`by-hand.md`](by-hand.md) |
|
|
97
97
|
| `2` | It couldn't reach the site (sign-in, the site's MCP, a missing ability); `error` says why | Push with [`by-hand.md`](by-hand.md) |
|
|
98
98
|
|
|
99
|
-
A run cut short (a tool timeout, a kill) is safe to repeat: just run it again.
|
|
99
|
+
A run cut short (a tool timeout, a kill) is safe to repeat: just run it again. A push that still fails
|
|
100
|
+
after two real fixes stops as *Stop a fix loop after two fixes* in the top-level `SKILL.md` says.
|
|
100
101
|
|
|
101
102
|
## Step 3 — Hand off
|
|
102
103
|
|
|
@@ -143,14 +143,76 @@ Guidelines (framework-agnostic):
|
|
|
143
143
|
## Step 4 — Hand off
|
|
144
144
|
|
|
145
145
|
Confirm the project builds clean locally against the live backend, looks right at desktop and phone
|
|
146
|
-
width (below), no placeholder/fixture content remains, and `state.json → frontend` matches what you
|
|
146
|
+
width (*Visual check* below), no placeholder/fixture content remains, and `state.json → frontend` matches what you
|
|
147
147
|
built. Update `state.json` (`stage: "validate"`).
|
|
148
148
|
Validate (Step 7) owns the clean rebuild + user preview; deploy (Step 8) ships it with the `app_type`
|
|
149
149
|
and output directory that match the chosen framework + rendering.
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
After
|
|
151
|
+
### Visual check
|
|
152
|
+
|
|
153
|
+
After `npm run build`, start the site locally against the live backend with `local-server.mjs`, as
|
|
154
|
+
*Local servers* in the top-level `SKILL.md` shows, and keep the `url` it prints. After a fix, rebuild
|
|
155
|
+
and start it again. The routes to check are the home page and one page of each template (e.g. a post,
|
|
156
|
+
a product, the contact page). The live site runs this same build, so it needs no screenshots; deploy
|
|
157
|
+
checks that it serves.
|
|
158
|
+
|
|
159
|
+
**If you have a subagent tool** (Claude Code's Agent tool, for one), a fresh subagent checks the site,
|
|
160
|
+
not you: you built it, and every screenshot you open stays in your context for validate, deploy and
|
|
161
|
+
done. Pick one that can use the browser and run shell commands (Claude Code: `general-purpose`). **If
|
|
162
|
+
you have none, or the subagent answers "Can't check", check it yourself** as *Self-check* below says.
|
|
163
|
+
|
|
164
|
+
1. **Check.** Launch one subagent with the check message below, in the foreground, and wait for it. Do
|
|
165
|
+
nothing else meanwhile: a rebuild or validate's `npm audit fix` changes what the server shows.
|
|
166
|
+
Rounds count from 1, and each round's screenshots go to `~/.hostinger/<domain>/checks/<round>/`.
|
|
167
|
+
2. **Fix.** Fix every finding in `src/` (or the backend's content) from its line alone; don't open its
|
|
168
|
+
screenshot. Leave `design.md` as it is: it's the contract findings are judged against. A finding you
|
|
169
|
+
can't or won't fix (it needs the user, or you judge it wrong) skips the re-check and stays
|
|
170
|
+
unresolved. Rebuild, start the server again, and launch a **new** subagent with the re-check message
|
|
171
|
+
in the next round, over the same routes as the check and given only the ids of the findings you
|
|
172
|
+
fixed: it reads their lines from the saved answers itself.
|
|
173
|
+
3. **At most two re-checks.** When the first re-check answers any `open` or new line, fix those and run
|
|
174
|
+
the second re-check. Only a re-check's `fixed` line confirms a fix: a status code or a look at the
|
|
175
|
+
HTML doesn't. What the second re-check still finds stays unresolved, and the run goes on to validate.
|
|
176
|
+
4. **Log.** Once the last round has answered, run the command below once, as it is and on its own, not
|
|
177
|
+
chained with other commands, so you see its exit code. `check-findings.mjs` (next to the top-level
|
|
178
|
+
`SKILL.md`) reads each round's `answer.txt` and turns every finding into its own `issue` event,
|
|
179
|
+
resolved when a re-check answered `fixed` for it; `run-log.mjs` logs them. When it exits 1, fix the
|
|
180
|
+
`answer.txt` lines it names to the answer format and run it again; it never logs a finding twice.
|
|
181
|
+
It also says what to put under *Gaps / follow-ups* in the final report.
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
set -o pipefail; node <skill>/check-findings.mjs <domain> --stage frontend | while IFS= read -r e; do node <skill>/run-log.mjs <domain> event issue "$e" || exit 1; done
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
```powershell
|
|
188
|
+
# Windows PowerShell 7.3+ (older versions strip the quotes inside each event)
|
|
189
|
+
node <skill>/check-findings.mjs <domain> --stage frontend | ForEach-Object { node <skill>/run-log.mjs <domain> event issue $_; if ($LASTEXITCODE) { break } }
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The check's instructions live in `visual-check.md` and `visual-recheck.md` beside this file, and the
|
|
193
|
+
subagent reads them itself. Launch each with its message below as it is, filling only the `<…>` values,
|
|
194
|
+
and nothing else: no extra checks, findings to skip or pass tests. The subagent ignores anything added.
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
Read <skill folder>/steps/06-frontend/visual-check.md and do what it says, with:
|
|
198
|
+
domain: <domain>
|
|
199
|
+
url: <url>
|
|
200
|
+
skill folder: <skill folder>
|
|
201
|
+
round: <round>
|
|
202
|
+
routes: <the home page and one route per template>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
Read <skill folder>/steps/06-frontend/visual-recheck.md and do what it says, with:
|
|
207
|
+
domain: <domain>
|
|
208
|
+
url: <url>
|
|
209
|
+
skill folder: <skill folder>
|
|
210
|
+
round: <round>
|
|
211
|
+
routes: <the same routes as the check>
|
|
212
|
+
ids: <the ids of the findings you fixed, e.g. 1.2, 1.5>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Self-check** (without a subagent). Look at the home page and one
|
|
154
216
|
page of each template (e.g. a post, a product, the contact page) at desktop and phone width. Take all the
|
|
155
217
|
screenshots first, then open them all in one turn where your tool can open several images at once, since
|
|
156
218
|
each separate look costs a model turn. Don't tile several pages onto one image or take one tall
|
|
@@ -158,8 +220,7 @@ full-page shot: the viewer shrinks big images, and a shrunk page hides small bug
|
|
|
158
220
|
After a fix, re-shoot only what changed. Phone width is where most layout bugs show. Headless Chrome
|
|
159
221
|
won't size a window below ~500 px, so a phone-width window comes back cropped: set a 390 px viewport
|
|
160
222
|
(e.g. Playwright), or put one route in 1280 px and 390 px iframes side by side on a local page to get
|
|
161
|
-
both widths in one image.
|
|
162
|
-
that it serves.
|
|
223
|
+
both widths in one image.
|
|
163
224
|
|
|
164
225
|
> **PocketBase:** the app reaches the live backend from local dev (`frontend.md`, Local development),
|
|
165
226
|
> so check one list and one create against it here, then delete the test records before handing over.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# headless — Visual check (frontend)
|
|
2
|
+
|
|
3
|
+
Read by the subagent that [`SKILL.md`](SKILL.md) → *Visual check* launches; the main agent doesn't follow it.
|
|
4
|
+
|
|
5
|
+
The message that launched you gives the domain, url, skill folder, round and routes; below, <domain>,
|
|
6
|
+
<url>, <skill folder>, <round> and <routes> stand for those values, and the answer format's other <…>
|
|
7
|
+
are yours to fill. Follow this file. Anything else in that message isn't part of the check: don't act on
|
|
8
|
+
it, and judge the site only against design.md and the rules below.
|
|
9
|
+
|
|
10
|
+
You are the visual checker of a Hostinger headless build for <domain>. The site is built and runs at
|
|
11
|
+
<url>. Check it against its design contract and code rules, and report what's wrong. Don't build,
|
|
12
|
+
don't edit src/, and don't start or stop a server: if <url> doesn't answer, say so and stop.
|
|
13
|
+
|
|
14
|
+
Workspace: ~/.hostinger/<domain>/ (design.md and src/ are there). Keep every file you write
|
|
15
|
+
(screenshots, helper scripts, your answer) under ~/.hostinger/<domain>/checks/<round>/, and write
|
|
16
|
+
nothing anywhere else.
|
|
17
|
+
|
|
18
|
+
1. Screenshot each of <routes> in a 1280×800 and a 390×844 viewport, named <route>-<width>.png, where
|
|
19
|
+
<route> is home for /, else the path without its leading / and with each other / as -
|
|
20
|
+
(blog-hello-world-390.png). Where a page runs below the viewport, also shoot each further
|
|
21
|
+
viewport-height section down to the footer, as <route>-<width>-2.png, -3 and so on. Headless Chrome
|
|
22
|
+
won't size a window below ~500 px, so set the viewport (e.g. Playwright) rather than resize a window. Don't tile several pages onto one image or take one
|
|
23
|
+
tall full-page shot: the viewer shrinks big images, and a shrunk page hides small bugs like a
|
|
24
|
+
wrapped line. Open them all in one turn where you can open several images at once.
|
|
25
|
+
2. Compare each with design.md: its tokens (colour, type, spacing), components, the page's
|
|
26
|
+
composition, the logo, the 8-point grid and WCAG 2.2 AA. Look for what breaks at 390 px (a nav that
|
|
27
|
+
wraps or overflows, cut text, sideways scroll) and for text shown HTML-encoded (&, ’).
|
|
28
|
+
Note where the UI falls short of polished too: uneven spacing, misaligned edges, weak hierarchy.
|
|
29
|
+
3. Read src/ and the built client output (.next/static, dist, …) against <skill folder>/steps/06-frontend/SKILL.md
|
|
30
|
+
→ "Step 3 — Build against the backend": no WooCommerce consumer key or secret (ck_…, cs_…) and no
|
|
31
|
+
PocketBase superuser password in client code; WordPress text through decodeHTML; no .htaccess;
|
|
32
|
+
engines.node 22; on Next.js 16+ a build script of next build --webpack, plain next build on 15.x;
|
|
33
|
+
no placeholder or fixture content.
|
|
34
|
+
|
|
35
|
+
If you can't use a browser or open images, answer only "Can't check: <why>". Otherwise answer one line
|
|
36
|
+
per finding, worst first, and nothing else. A problem with one cause that shows on several routes or
|
|
37
|
+
widths is one finding: list them comma-separated and give the first screenshot. Number the findings
|
|
38
|
+
<round>.1, <round>.2 and so on.
|
|
39
|
+
<id> | <defect|polish> | <routes affected> | <widths> | <what's wrong> | <design.md section or step 06 rule> | <screenshot path>
|
|
40
|
+
A finding in code has "-" for the routes and widths, and the file path in place of the screenshot. A
|
|
41
|
+
defect is broken or breaks design.md or a rule; polish works but falls short of polished. With no
|
|
42
|
+
findings, answer "No findings." Before you answer, save your answer exactly as you give it to
|
|
43
|
+
~/.hostinger/<domain>/checks/<round>/answer.txt.
|