hostinger-api-mcp 4.13.0 → 4.14.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +13 -13
  3. package/gemini-extension.json +1 -1
  4. package/package.json +1 -1
  5. package/server.json +2 -2
  6. package/skills/headless/SKILL.md +67 -50
  7. package/skills/headless/VERSION +3 -3
  8. package/skills/headless/connect/SKILL.md +60 -35
  9. package/skills/headless/connect/tools/antigravity.md +4 -6
  10. package/skills/headless/connect/tools/claude-code.md +3 -5
  11. package/skills/headless/connect/tools/codex.md +3 -5
  12. package/skills/headless/connect/tools/cursor.md +4 -5
  13. package/skills/headless/connect/tools/devin.md +4 -6
  14. package/skills/headless/connect/tools/vscode.md +4 -6
  15. package/skills/headless/report.schema.json +1 -1
  16. package/skills/headless/run-log.mjs +42 -13
  17. package/skills/headless/steps/{02-refine → 01-refine}/SKILL.md +51 -22
  18. package/skills/headless/steps/{01-check-state → 02-check-state}/SKILL.md +56 -46
  19. package/skills/headless/steps/03-provision/ecommerce/SKILL.md +1 -1
  20. package/skills/headless/steps/04-content-model/SKILL.md +12 -10
  21. package/skills/headless/steps/09-done/SKILL.md +4 -4
  22. package/src/core/runtime.js +1 -1
  23. package/src/core/runtime.ts +1 -1
  24. package/src/core/skills.js +47 -47
  25. package/src/core/skills.ts +47 -47
  26. package/src/core/tools/all.js +6 -6
  27. package/src/core/tools/all.ts +6 -6
  28. package/src/core/tools/horizons.js +6 -6
  29. package/src/core/tools/horizons.ts +6 -6
  30. package/src/servers/agency-hosting.js +1 -1
  31. package/src/servers/agency-hosting.ts +1 -1
  32. package/src/servers/agent-readiness.js +1 -1
  33. package/src/servers/agent-readiness.ts +1 -1
  34. package/src/servers/all.js +1 -1
  35. package/src/servers/all.ts +1 -1
  36. package/src/servers/billing.js +1 -1
  37. package/src/servers/billing.ts +1 -1
  38. package/src/servers/dns.js +1 -1
  39. package/src/servers/dns.ts +1 -1
  40. package/src/servers/domains.js +1 -1
  41. package/src/servers/domains.ts +1 -1
  42. package/src/servers/ecommerce.js +1 -1
  43. package/src/servers/ecommerce.ts +1 -1
  44. package/src/servers/gpu.js +1 -1
  45. package/src/servers/gpu.ts +1 -1
  46. package/src/servers/horizons.js +1 -1
  47. package/src/servers/horizons.ts +1 -1
  48. package/src/servers/hosting.js +1 -1
  49. package/src/servers/hosting.ts +1 -1
  50. package/src/servers/mail.js +1 -1
  51. package/src/servers/mail.ts +1 -1
  52. package/src/servers/reach.js +1 -1
  53. package/src/servers/reach.ts +1 -1
  54. package/src/servers/vps.js +1 -1
  55. package/src/servers/vps.ts +1 -1
  56. package/src/servers/wordpress.js +1 -1
  57. package/src/servers/wordpress.ts +1 -1
  58. package/types.d.ts +13 -13
@@ -36,12 +36,10 @@ args = ["<launcher>", "hostinger-ecommerce-mcp"]
36
36
  ```
37
37
 
38
38
  Codex loads MCP servers only when it starts, so follow *register, restart, resume* in
39
- `connect/SKILL.md`: write `connect.json`, then ask the user to restart Codex and paste the
39
+ `connect/SKILL.md`, which says when a restart is needed. When it is, ask the user to restart Codex and paste the
40
40
  same prompt. Never spawn the server yourself or write a JSON-RPC client to reach it.
41
41
 
42
42
  ## Step 2 — Hand off
43
43
 
44
- The skills are already in place: Phase 1 of `connect/SKILL.md` found the installed `<skill>`
45
- folder or installed it from the `@hostinger/mcp` release. Don't download them again here. Read the
46
- `<skill>/VERSION` stamp (record it in `connect.json`), open `<skill>/SKILL.md` and follow its
47
- steps. That skill owns the rest of the run.
44
+ The skills are already in place: Phase 1 of `connect/SKILL.md` found `<skill>` and its
45
+ `<skill>/VERSION` stamp. Go back to `connect/SKILL.md`, Phase 4.
@@ -60,7 +60,8 @@ OAuth can run:
60
60
  ```
61
61
 
62
62
  Cursor loads MCP servers only when the editor starts, so after Step 2 write `connect.json` and follow
63
- *register, restart, resume* in `connect/SKILL.md`: ask the user to fully quit and reopen Cursor
63
+ *register, restart, resume* in `connect/SKILL.md`, which says when a restart is needed. When it is,
64
+ ask the user to fully quit and reopen Cursor
64
65
  (and, if Cursor asks, enable the two Hostinger servers under Settings → MCP), then paste the same
65
66
  prompt. Never spawn the server yourself or write a JSON-RPC client to reach it: every connector call
66
67
  must be a native MCP tool call.
@@ -102,7 +103,5 @@ cd "$HOME" && node "$HOME/.hostinger/mcp/launch.mjs" --logout
102
103
 
103
104
  ## Step 3 — Hand off
104
105
 
105
- The skills are already in place: Phase 1 of `connect/SKILL.md` found the installed `<skill>`
106
- folder or installed it from the `@hostinger/mcp` release. Don't download them again here. Read the
107
- `<skill>/VERSION` stamp (record it in `connect.json`), open `<skill>/SKILL.md` and follow its
108
- steps. That skill owns the rest of the run.
106
+ The skills are already in place: Phase 1 of `connect/SKILL.md` found `<skill>` and its
107
+ `<skill>/VERSION` stamp. Go back to `connect/SKILL.md`, Phase 4.
@@ -35,14 +35,12 @@ tokens to handle.
35
35
  { "command": "<command>", "args": ["<launcher>", "hostinger-ecommerce-mcp"] }
36
36
  ```
37
37
 
38
- If the tools still aren't in this session, follow *register, restart, resume* in `connect/SKILL.md`:
39
- write `connect.json`, then ask the user to restart the Devin session (on Devin Desktop,
38
+ If the tools still aren't in this session, follow *register, restart, resume* in `connect/SKILL.md`,
39
+ which says when a restart is needed. When it is, ask the user to restart the Devin session (on Devin Desktop,
40
40
  fully quit and reopen the app) and paste the same prompt. Never spawn the server yourself or write a
41
41
  JSON-RPC client to reach it.
42
42
 
43
43
  ## Step 2 — Hand off
44
44
 
45
- The skills are already in place: Phase 1 of `connect/SKILL.md` found the installed `<skill>`
46
- folder or installed it from the `@hostinger/mcp` release. Don't download them again here. Read the
47
- `<skill>/VERSION` stamp (record it in `connect.json`), open `<skill>/SKILL.md` and follow its
48
- steps. That skill owns the rest of the run.
45
+ The skills are already in place: Phase 1 of `connect/SKILL.md` found `<skill>` and its
46
+ `<skill>/VERSION` stamp. Go back to `connect/SKILL.md`, Phase 4.
@@ -48,13 +48,11 @@ VS Code picks up new servers and their tools become available right away, with n
48
48
  (Alternatively, the official Hostinger Connector extension installs the same server:
49
49
  `code --install-extension hostinger-official.hostinger-connector`.)
50
50
 
51
- If the tools still don't show up, follow *register, restart, resume* in `connect/SKILL.md`: write
52
- `connect.json`, then ask the user to run **Developer: Reload Window** and paste the same
51
+ If the tools still don't show up, follow *register, restart, resume* in `connect/SKILL.md`, which
52
+ says when a restart is needed. When it is, ask the user to run **Developer: Reload Window** and paste the same
53
53
  prompt. Never spawn the server yourself or write a JSON-RPC client to reach it.
54
54
 
55
55
  ## Step 2 — Hand off
56
56
 
57
- The skills are already in place: Phase 1 of `connect/SKILL.md` found the installed `<skill>`
58
- folder or installed it from the `@hostinger/mcp` release. Don't download them again here. Read the
59
- `<skill>/VERSION` stamp (record it in `connect.json`), open `<skill>/SKILL.md` and follow its
60
- steps. That skill owns the rest of the run.
57
+ The skills are already in place: Phase 1 of `connect/SKILL.md` found `<skill>` and its
58
+ `<skill>/VERSION` stamp. Go back to `connect/SKILL.md`, Phase 4.
@@ -62,7 +62,7 @@
62
62
  "type": "object",
63
63
  "required": ["stage", "started_at", "ended_at", "result"],
64
64
  "properties": {
65
- "stage": { "type": "string", "enum": ["connect", "check_state", "refine", "provision", "content_model", "design", "frontend", "validate", "deploy", "done"] },
65
+ "stage": { "type": "string", "enum": ["refine", "connect", "check_state", "provision", "content_model", "design", "frontend", "validate", "deploy", "done"] },
66
66
  "phase": { "type": ["string", "null"] },
67
67
  "started_at": { "type": "string" },
68
68
  "ended_at": { "type": ["string", "null"] },
@@ -19,7 +19,12 @@ import { homedir } from 'node:os';
19
19
  import { dirname, join } from 'node:path';
20
20
  import { fileURLToPath } from 'node:url';
21
21
 
22
- const STAGES = ['connect', 'check_state', 'refine', 'provision', 'content_model', 'design', 'frontend', 'validate', 'deploy', 'done'];
22
+ const STAGES = ['refine', 'connect', 'check_state', 'provision', 'content_model', 'design', 'frontend', 'validate', 'deploy', 'done'];
23
+ // Stages that stop for the user to restart their tool, so it loads a newly registered Hostinger MCP server.
24
+ const RESTART_STAGES = ['connect', 'provision', 'content_model'];
25
+ const PAUSE_NOTE = 'paused for a tool restart';
26
+ // A domain names a folder under ~/.hostinger, so "../x" or "a/b" must never reach the file system.
27
+ const HOSTNAME = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$/i;
23
28
  const RESULTS = ['ok', 'ok_after_retries', 'ok_with_fixups', 'failed', 'skipped', 'stopped'];
24
29
  const OUTCOMES = ['live', 'stopped', 'failed', 'abandoned'];
25
30
  const EVENT_FIELDS = {
@@ -69,10 +74,13 @@ function parseArgs(argv) {
69
74
  const readJson = (file, fallback) => (existsSync(file) ? JSON.parse(readFileSync(file, 'utf8')) : fallback);
70
75
  const writeJson = (file, value) => writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
71
76
 
72
- function workspace(domain) {
77
+ // run-start is a run's first command, before anything else has written to the workspace.
78
+ function workspace(domain, { create = false } = {}) {
73
79
  if (!domain || domain.startsWith('-')) fail('first argument must be the domain');
80
+ if (!HOSTNAME.test(domain)) fail(`"${domain}" is not a domain (use its ASCII form, e.g. xn--caf-dma.com)`);
74
81
  const dir = join(homedir(), '.hostinger', domain);
75
- if (!existsSync(dir)) fail(`no workspace at ${dir}; connect creates it`);
82
+ if (create) mkdirSync(dir, { recursive: true });
83
+ else if (!existsSync(dir)) fail(`no workspace at ${dir}; run-start creates it`);
76
84
  return {
77
85
  dir,
78
86
  domain,
@@ -112,7 +120,7 @@ function migrate(ws) {
112
120
  }
113
121
 
114
122
  function currentRun(log) {
115
- if (!log.run?.id) fail('no run started; call run-start first (check-state does this)');
123
+ if (!log.run?.id) fail('no run started; call run-start first (the start of every run does this)');
116
124
  return log.run;
117
125
  }
118
126
 
@@ -135,6 +143,23 @@ function readConnect(ws) {
135
143
 
136
144
  function runStart(ws, flags) {
137
145
  const log = loadLog(ws);
146
+ // A run left open in a restart stage goes on in the new session, at connect, instead of being
147
+ // abandoned. The paused stage ends at its last logged activity, so the restart wait isn't counted.
148
+ // A clean pause deletes .lock, so one still there means a crash or another window: not a pause.
149
+ const history = (log.history ?? []).filter((h) => h.run === log.run?.id);
150
+ const open = history.filter((h) => !h.ended_at);
151
+ const pausedCleanly = !existsSync(join(ws.dir, '.lock'));
152
+ if (log.run?.id && !log.run.reported_at && pausedCleanly && open.length === 1 && RESTART_STAGES.includes(open[0].stage)) {
153
+ const [paused] = open;
154
+ for (const key of ['model', 'skill']) if (typeof flags[key] === 'string') log.run[key] = flags[key];
155
+ const events = readEvents(ws).filter((e) => e.run === log.run.id);
156
+ Object.assign(paused, { ended_at: lastActivity(log.run, history, events), result: 'ok', note: paused.note ? `${paused.note}; ${PAUSE_NOTE}` : PAUSE_NOTE });
157
+ log.history.push({ run: log.run.id, stage: 'connect', phase: null, started_at: now(), ended_at: null, result: null, note: 'continued after a tool restart' });
158
+ saveLog(ws, log);
159
+ const where = `${paused.stage}${paused.phase ? `/${paused.phase}` : ''}`;
160
+ console.log(`run ${log.run.id} continued after a tool restart in ${where}; next: connect`);
161
+ return;
162
+ }
138
163
  // A previous run that never reached its report (closed window, crash) is closed out first, so
139
164
  // its log still turns into a report.
140
165
  if (log.run?.id && !log.run.reported_at) {
@@ -164,8 +189,9 @@ function runStart(ws, flags) {
164
189
  skill: flags.skill ?? previous.skill ?? null,
165
190
  };
166
191
  fresh.history ??= [];
192
+ fresh.history.push({ run: id, stage: 'refine', phase: null, started_at: startedAt, ended_at: null, result: null, note: null });
167
193
  saveLog(ws, fresh);
168
- console.log(`run ${fresh.run.id} started`);
194
+ console.log(`run ${fresh.run.id} started; next: refine`);
169
195
  }
170
196
 
171
197
  function runUpdate(ws, flags) {
@@ -332,12 +358,8 @@ function buildReport(ws, { outcome, tokens } = {}) {
332
358
  // A run ends at its last logged activity, so re-running `report` later (after fixing warnings, or
333
359
  // when the next run-start closes an abandoned run) doesn't stretch it to "now". Only a stage still
334
360
  // open on a live run keeps the clock running.
335
- const lastActivity = [run.started_at, ...history.flatMap((h) => [h.started_at, h.ended_at]), ...events.map((e) => e.ts)]
336
- .filter(Boolean)
337
- .sort()
338
- .at(-1);
339
361
  const stillOpen = resolvedOutcome !== 'abandoned' && history.some((h) => !h.ended_at);
340
- const endedAt = stillOpen ? now() : lastActivity;
362
+ const endedAt = stillOpen ? now() : lastActivity(run, history, events);
341
363
  const stages = history.map((h) => ({ ...h, minutes: minutesBetween(h.started_at, h.ended_at ?? endedAt) }));
342
364
  const gaps = [...loggingGaps(stages, run, resolvedOutcome), ...dropped];
343
365
  const strip = ({ ts, run: _run, type: _type, ...rest }) => ({ ...rest, logged_at: ts });
@@ -448,7 +470,7 @@ function reportRejected(ws, [runId]) {
448
470
  }
449
471
 
450
472
  // Gaps are printed as warnings by `report`, so guesses never pass as measurements.
451
- const EXPECTED_FOR_BUILD = ['check_state', 'refine', 'provision', 'content_model', 'design', 'frontend', 'validate', 'deploy'];
473
+ const EXPECTED_FOR_BUILD = STAGES.filter((stage) => stage !== 'done');
452
474
  function loggingGaps(stages, run, outcome) {
453
475
  const gaps = [];
454
476
  for (const s of stages) {
@@ -456,7 +478,7 @@ function loggingGaps(stages, run, outcome) {
456
478
  const problem = s.result === 'skipped' ? null
457
479
  : !s.ended_at ? 'started but never ended'
458
480
  : s.start_estimated ? 'start time estimated, not measured'
459
- : Date.parse(s.ended_at) === Date.parse(s.started_at) ? 'logged with no duration; probably started and ended in one go after the work'
481
+ : Date.parse(s.ended_at) === Date.parse(s.started_at) && !s.note?.endsWith(PAUSE_NOTE) ? 'logged with no duration; probably started and ended in one go after the work'
460
482
  : null;
461
483
  if (problem) gaps.push({ stage: s.stage, phase: s.phase, problem });
462
484
  }
@@ -468,6 +490,13 @@ function loggingGaps(stages, run, outcome) {
468
490
  return gaps;
469
491
  }
470
492
 
493
+ function lastActivity(run, history, events) {
494
+ return [run.started_at, ...history.flatMap((h) => [h.started_at, h.ended_at]), ...events.map((e) => e.ts)]
495
+ .filter(Boolean)
496
+ .sort()
497
+ .at(-1);
498
+ }
499
+
471
500
  function stoppedAt(stages, fallbackStage) {
472
501
  const stuck = [...stages].reverse().find((s) => !s.ended_at || s.result === 'failed' || s.result === 'stopped');
473
502
  return stuck?.stage ?? fallbackStage ?? null;
@@ -661,7 +690,7 @@ document.querySelectorAll('.bar').forEach((el) => {
661
690
 
662
691
  const { positional, flags } = parseArgs(process.argv.slice(2));
663
692
  const [domain, command, ...rest] = positional;
664
- const ws = workspace(domain);
693
+ const ws = workspace(domain, { create: command === 'run-start' });
665
694
  switch (command) {
666
695
  case 'run-start':
667
696
  runStart(ws, flags);
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: headless-step-refine
3
- description: "Step 2 (refine) of the Hostinger Headless flow. Turns the user's seed — often just a domain — into a brief through conversation: asks what they want to build (purpose, audience, tone, pages, products, must-haves; images, local files, links all welcome), then *infers* the backend that fits (WordPress, Ecommerce, WordPress + Ecommerce, WordPress + WooCommerce for a one-site content+store, or PocketBase for a custom app/SPA or any site whose visitors create its data: accounts, bookings, comments, votes, order requests) — it never asks the user to pick a backend or a technology; it asks for the site name (suggesting a few when the user has none), the user confirms the plan in plain language, and only after their yes it writes brief.md. Hostinger Ecommerce stays the default for selling; WooCommerce is chosen only when the user explicitly asks for it or wants content and a store on one WordPress site."
3
+ description: "Step 1 (refine) of the Hostinger Headless flow, the first stage the user talks to, run before the Hostinger connection. Turns the user's seed — often just a domain — into a brief through conversation: asks what they want to build (purpose, audience, tone, pages, products, must-haves; images, local files, links all welcome), then *infers* the backend that fits (WordPress, Ecommerce, WordPress + Ecommerce, WordPress + WooCommerce for a one-site content+store, or PocketBase for a custom app/SPA or any site whose visitors create its data: accounts, bookings, comments, votes, order requests) — it never asks the user to pick a backend or a technology; it asks for the site name (suggesting a few when the user has none), the user confirms the plan (and the image source) in plain language, and only after their yes it writes brief.md. Hostinger Ecommerce stays the default for selling; WooCommerce is chosen only when the user explicitly asks for it or wants content and a store on one WordPress site."
4
4
  ---
5
5
 
6
6
  # headless-step-refine
@@ -28,28 +28,45 @@ question tool is not the user passing on a question; see *When you ask the user*
28
28
  **In:** the domain (the workspace directory name), plus anything the user already shared.
29
29
  **Out:** `~/.hostinger/<domain>/brief.md`.
30
30
 
31
- Nothing in this step touches Hostinger. It only asks, decides and writes.
31
+ Nothing in this step touches Hostinger. It runs before the connection (*Start of a run* in the
32
+ top-level `SKILL.md`), so it reads only the local workspace and the user; check-state checks the plan
33
+ against Hostinger afterwards and sends the run back here when the site fixes the backend. Refine is
34
+ the only writer of `brief.md`. It only asks, decides and writes.
32
35
 
33
36
  ---
34
37
 
35
38
  ## Step 1 — Read the workspace, then the resume check
36
39
 
37
- Read everything already in `~/.hostinger/<domain>/` (`state.json`, `connect.json`, any notes, images
38
- or files the user dropped there) — it all counts as input.
39
-
40
- If `brief.md` already exists for this domain, **don't overwrite it**. Show the user a three-line
41
- summary (what the site is, its pages, the suggested backend) and ask: *keep it, or change something?*
42
- Keep → go to Step 6, unless the brief has no **Site name** section: then ask Round 1 question 4 first
43
- and add it. Change → edit only what they asked for, then re-confirm (Step 5). A skipped tool result is
44
- not Keep; see *When you ask the user* in the top-level `SKILL.md`.
45
-
46
- If the site is already provisioned (`site.json` exists), the backend is **fixed** — never change the
47
- Suggested backend on a provisioned site. Explain that switching backends means a new domain. The same
48
- holds when check-state found an onboarding site of setup type `headless_pocketbase`: onboarding has
49
- already chosen PocketBase, so the backend is **PocketBase**. Refine still finds out what to build, but
50
- never picks another backend for that domain. A `brief.md` whose Suggested backend is **Webapp** is
51
- from an older flow: re-decide it in Step 4 (it becomes **PocketBase**, or the user is pointed at the
52
- `deploy-to-hosting` skill).
40
+ Read everything already in `~/.hostinger/<domain>/` (`state.json`, any notes, images or files the
41
+ user dropped there) — it all counts as input.
42
+
43
+ If `brief.md` already exists for this domain, **don't overwrite it**:
44
+
45
+ - **Later build artifacts exist too** (`site.json`, `design.md`, `content-model.md`, `src/`): the
46
+ build is under way, and check-state offers to resume it once you're connected. Ask nothing here,
47
+ even when the pasted prompt says to start by asking what to build:
48
+ `node <skill>/run-log.mjs <domain> stage-end refine skipped --note "build under way"`, and go on.
49
+ - **Only the brief:** show the user a three-line summary (what the site is, its pages, the suggested
50
+ backend) and ask: *keep it, or change something?* Keep → go to Step 6, unless the brief has no
51
+ **Site name** or **Images** section: then ask what's missing first (Round 1 question 4, or the
52
+ Step 5 images line) and add it. Change → edit only what they asked for, then re-confirm (Step 5).
53
+ A skipped tool result is not Keep; see *When you ask the user* in the top-level `SKILL.md`.
54
+
55
+ **A fixed backend.** On the first pass the backend is yours to pick from the conversation: what
56
+ onboarding set up on Hostinger isn't visible before the connection. It is **fixed** — never change
57
+ the Suggested backend — in two cases:
58
+
59
+ - **The site is already provisioned** (`site.json` exists). Explain that switching backends means a
60
+ new domain.
61
+ - **Check-state sent you back because the site fixes it** (an onboarding PocketBase site, or a live
62
+ site with a real backend). Re-decide
63
+ what follows from that backend (Step 4's rendering, the Step 5 images line), then go to Step 5: its
64
+ message opens by saying the site already runs on that backend and what changes for the user. When
65
+ the plan needs what that backend can't do (checkout, a CMS the owner writes in), say so in the same
66
+ message and offer to build on another domain instead.
67
+
68
+ A `brief.md` whose Suggested backend is **Webapp** is from an older flow: re-decide it in Step 4 (it
69
+ becomes **PocketBase**, or the user is pointed at the `deploy-to-hosting` skill).
53
70
 
54
71
  ## Step 2 — Gather what you already have
55
72
 
@@ -79,7 +96,8 @@ If Step 2 already answers the Round 1 questions, skip the Round 1–3 questions
79
96
  open with one line and **wait for the user's answer**: *"Tell me what you want to build — a
80
97
  sentence is enough. Links, screenshots or files help too. Skip anything you don't want to answer."*
81
98
 
82
- The opener is its own message, sent after check-state. Of the rounds it asks Round 1 only (plus the
99
+ The opener is the run's first message (see *The first message* in the top-level `SKILL.md`), sent
100
+ before any Hostinger setup. Of the rounds it asks Round 1 only (plus the
83
101
  Build mode and Existing project confirms above, when they apply). Never fold Round 2 or 3 into it
84
102
  (audience, pages, look, content or logo), not even as a numbered list under the opening question.
85
103
 
@@ -268,10 +286,16 @@ build** — the plan, not the plumbing. Lead with the site, not the backend:
268
286
  WordPress admin"; for PocketBase: "Bookings and accounts are saved on your site, and you see and
269
287
  manage them in your site's dashboard"), **not** as a choice you're asking them to make. Don't ask "is WordPress OK?" or
270
288
  offer alternatives unless it was a genuine close call *and* the difference matters to the user.
289
+ - **Images** — where the site's photos come from, as one line with this backend's default and the
290
+ other options, both from the table in `../04-content-model/SKILL.md` → *Images*. For example, on
291
+ WordPress: "I'll generate the images with Hostinger AI to match the design; say if you'd rather have
292
+ stock photos from Unsplash." It's content's one choice, asked here because it needs the user and
293
+ not Hostinger, so nothing later stops to ask it.
271
294
 
272
295
  End with *"Good to go, or anything to change?"* and end your turn there: nothing after refine
273
296
  (provision, content, design, logo) starts until the user replies (see *When you ask the user* in the
274
- top-level `SKILL.md` for a run no one will answer). A yes (or "go") → write `brief.md`. A skipped tool
297
+ top-level `SKILL.md` for a run no one will answer). A yes (or "go") → write `brief.md`, with the
298
+ default image source unless they picked another. A skipped tool
275
299
  result is not a yes (see *When you ask the user* in the top-level `SKILL.md`). Changes → apply them
276
300
  and write it; don't loop back into questions. If the user *volunteers* a different backend, use theirs
277
301
  and note it in the brief.
@@ -281,8 +305,9 @@ and note it in the brief.
281
305
  Write `brief.md` from the template below. Fill every section from the conversation, defaulting what
282
306
  the user skipped and tagging it `(assumed)`; leave out **Products** when nothing is sold and
283
307
  **Existing project** unless Step 2 found a project in the folder. Use the user's own words where you
284
- can. Then update `state.json`:
285
- `"stage": "provision"`, fresh `updated_at`.
308
+ can. Then set `state.json` → `stage` to the stage *Start of a run* in the top-level `SKILL.md` names
309
+ after refine (`connect` on the first pass, else the stage that sent the run back here), with a fresh
310
+ `updated_at`, and go on to it.
286
311
 
287
312
  The **Suggested backend** section is the contract with `03-provision/SKILL.md`, which routes on it.
288
313
  Its first line must be exactly one of `**WordPress**`, `**Ecommerce**`, `**WordPress + Ecommerce**`,
@@ -344,6 +369,10 @@ var names the app reads — names only, never values>
344
369
  **<WordPress | Ecommerce | WordPress + Ecommerce | WordPress + WooCommerce | PocketBase>** — <one-line reason>.
345
370
  <"Confirmed by the user." or "User chose this over the recommended <X> because <reason>.">
346
371
 
372
+ ## Images
373
+ **<Hostinger AI | Unsplash | Generated by the agent>** — <"Chosen by the user." | "Default for this
374
+ backend, shown in the plan confirm.">
375
+
347
376
  ## Build mode
348
377
  **<Bring your own frontend | Agent designs and builds>** — <one line>. <When "Bring your own frontend":
349
378
  how they want to drive design/code; the project's path is under **Existing project**. When "Agent designs and builds": leave the design + frontend steps to run as
@@ -1,15 +1,16 @@
1
1
  ---
2
2
  name: headless-step-check-state
3
- description: "First build step of the Hostinger Headless flow, run right after connect. Works out where a given domain's build stands — is a run already in progress, does the site already exist, how far did it get — by reconciling the global workspace state under ~/.hostinger/<domain>/ with what the Hostinger connector reports, then guides the user to continue, switch or buy a domain, or start over. Owns all resume/position logic for the flow."
3
+ description: "Build step of the Hostinger Headless flow, run right after connect, once refine has agreed the brief. Works out where a given domain's build stands — is a run already in progress, does the site already exist, how far did it get — by reconciling the global workspace state under ~/.hostinger/<domain>/ with what the Hostinger connector reports, then guides the user to continue, switch or buy a domain, or start over. Owns all resume/position logic for the flow."
4
4
  ---
5
5
 
6
6
  # headless-step-check-state
7
7
 
8
- The first build step of the Hostinger Headless flow (orchestrated by `hostinger.com/headless/skill.md`),
9
- run right after connect. Connect has already connected the Hostinger connector and confirmed the
10
- account can build. Your job here is to
11
- **figure out where this domain stands and agree the route with the user** before any new work begins.
12
- This step owns all resume/position logic — no other stage second-guesses it.
8
+ A build step of the Hostinger Headless flow (orchestrated by `hostinger.com/headless/skill.md`), run
9
+ right after connect. Refine has already agreed the brief (`brief.md`) from the local workspace alone,
10
+ and connect has connected the Hostinger connector and confirmed the account can build. Your job here
11
+ is to **figure out where this domain stands and agree the route with the user** before any new work
12
+ on Hostinger begins, including what refine couldn't see without Hostinger (Step 3). This step owns
13
+ all resume/position logic — no other stage second-guesses it.
13
14
 
14
15
  Nothing in this step creates, provisions, deploys, or deletes anything. It reads and guides. Its
15
16
  only writes to Hostinger are unsent build reports (Step 0) and the tool-connected event (Step 3).
@@ -19,20 +20,18 @@ Everything for this domain lives in its global workspace `~/.hostinger/<domain>/
19
20
 
20
21
  ---
21
22
 
22
- ## Step 0 — Start the run log
23
+ ## Step 0 — Log the stage, send unsent reports
23
24
 
24
- Before anything else, start a run and the stage (see *Run log and build report* in the top-level
25
- `SKILL.md`):
25
+ The run log started before refine (*Start of a run* in the top-level `SKILL.md`). Before anything
26
+ else, end connect's stage, start this one and list the reports still to send:
26
27
 
27
28
  ```bash
28
- node <skill>/run-log.mjs <domain> run-start --tool <tool> --model <model> --skill <skill version> && \
29
29
  node <skill>/run-log.mjs <domain> next check_state && \
30
30
  node <skill>/run-log.mjs <domain> unsent
31
31
  ```
32
32
 
33
- If an earlier run on this domain never wrote its report, `run-start` closes it as `abandoned` first.
34
- `unsent` lists the build reports that haven't reached Hostinger yet (that abandoned run, or a send
35
- that failed last time).
33
+ `unsent` lists the build reports that haven't reached Hostinger yet (a run that `run-start` closed as
34
+ `abandoned`, or a send that failed last time).
36
35
 
37
36
  Each line is `<run> <path>`. For each, send the file through `hosting_headless_submit-build-report`
38
37
  and record the result, as described in *Run log and build report* in the top-level `SKILL.md`. One
@@ -70,12 +69,9 @@ and **release it on a clean stop** (Step 6). The lock marks an active session, n
70
69
 
71
70
  ## Step 2 — Read the workspace directory
72
71
 
73
- Check `~/.hostinger/<domain>/` by its exact path (for example `test -d ~/.hostinger/<domain>`), not
74
- by listing `~/.hostinger/`:
75
-
76
- - **Absent** → no history for this domain in the workspace.
77
- - **Present** → read `state.json` (its `stage`) and whatever artifacts exist (`brief.md`,
78
- `site.json`, …). Treat these as a hint, not the truth.
72
+ Open `~/.hostinger/<domain>/` by its exact path, not by listing `~/.hostinger/`. Refine has always
73
+ written to it by now: read `state.json` (its `stage`) and whatever artifacts exist (`brief.md`,
74
+ `site.json`, …). Treat these as a hint, not the truth.
79
75
 
80
76
  ---
81
77
 
@@ -106,14 +102,18 @@ Query the Hostinger connector — the local files are never trusted on their own
106
102
  ownership: "all" }` returns **no** `/cms` row, `hosting_pocketbase_backend { username, domain }`
107
103
  returns 404 or `state: "missing"` (the same test provision uses), and there is no `site.json`
108
104
  recording a backend. It is a **new build** that
109
- happens to already own its website, not a finished or resumable one. Route it to **refine** (choose
110
- the backend), then **provision** adopts the shell and swaps it to that backend (provision's subfolder
111
- repeats this check before swapping). Never create a second site, and never skip provision for it.
112
- `headless_pocketbase` is **not** an empty shell: onboarding chose PocketBase, so refine keeps the
113
- backend fixed as **PocketBase** and provision creates the backend if it isn't there yet
105
+ happens to already own its website, not a finished or resumable one. Route it to **provision**,
106
+ which adopts the shell and swaps it to the brief's backend (provision's subfolder repeats this check
107
+ before swapping). Never create a second site, and never skip provision for it.
108
+ `headless_pocketbase` is **not** an empty shell: onboarding chose PocketBase, so the backend is
109
+ fixed as **PocketBase** and provision creates the backend if it isn't there yet
114
110
  (`hosting_pocketbase_backend` → 404 or state `missing` means not yet). After 24 h the setup row is
115
- gone and the public API can't tell such a site with no backend from an empty shell; refine then
116
- decides the backend as for any empty shell.
111
+ gone and the public API can't tell such a site with no backend from an empty shell; the brief's
112
+ backend then stands, as for any empty shell.
113
+ - **Does the brief fit what's there?** Refine ran before the connection, so it chose the backend
114
+ from the conversation alone. When the site already fixes the backend (an onboarding PocketBase
115
+ site, or a site with a real backend) and `brief.md`'s **Suggested backend** names another, the site
116
+ wins: Step 5 sends the run back to refine.
117
117
  - **A `site.json → backend: "webapp"`** is from an older flow that built a plain Node.js host, which
118
118
  this version no longer does. Tell the user in one line and point them at the `deploy-to-hosting`
119
119
  skill for that app; don't resume it as a headless build.
@@ -125,17 +125,16 @@ corrected.
125
125
 
126
126
  ## Step 4 — Determine the position
127
127
 
128
- Connect always writes `state.json` (with `stage: check_state`) before this step runs, so local
129
- state is never truly empty. **"Local state: none" here means only connect artifacts exist** —
130
- `connect.json` + a `state.json` still pointing at `check_state`/`refine`, and **no build artifacts
131
- yet** (`brief.md`, `site.json`, …).
128
+ Refine has always run before this step, and agreed or kept the brief with the user. **"Brief only"
129
+ here means that brief and nothing built after it:** `brief.md`, `connect.json`, and **no other build
130
+ artifacts** (`site.json`, `design.md`, `content-model.md`, `src/`, …).
132
131
 
133
132
  | Local state | Reality (domain) | Position |
134
133
  |---|---|---|
135
- | none (connect only) | free | **new build** — start from refine |
136
- | none (connect only) | empty headless shell (onboarding) | **new build on an existing shell** — start from refine; provision adopts the shell and swaps it to the chosen backend. Never create a second site, never skip provision |
137
- | none (connect only) | onboarding PocketBase site (setup `type` `headless_pocketbase`) | **new build on an existing PocketBase site** — start from refine with the backend fixed as PocketBase; provision creates the backend if it isn't there yet. Not something to resume, even when the backend already exists: nothing has been built on it |
138
- | none (connect only) | site exists with a real backend | **adopt / resume** — never create a second site; route to the first unfinished stage |
134
+ | brief only | free | **new build** — go on to provision |
135
+ | brief only | empty headless shell (onboarding) | **new build on an existing shell** — go on to provision, which adopts the shell and swaps it to the brief's backend. Never create a second site, never skip provision |
136
+ | brief only | onboarding PocketBase site (setup `type` `headless_pocketbase`) | **new build on an existing PocketBase site** — the backend is PocketBase (back to refine first when the brief named another, Step 5); go on to provision, which creates the backend if it isn't there yet. Not something to resume, even when the backend already exists: nothing has been built on it |
137
+ | brief only | site exists with a real backend | **adopt / resume** — a live site built elsewhere; never create a second site. Offer resume or iterate, with the brief as what the user asked for |
139
138
  | build artifacts present, incomplete | matches | **resume** at `state.json`'s `stage` |
140
139
  | build artifacts present | disagrees | **reality wins** — recompute the stage from what actually exists |
141
140
  | build artifacts present, all done | live site exists | **finished** — this is now an *iterate* request, not a build |
@@ -145,16 +144,27 @@ yet** (`brief.md`, `site.json`, …).
145
144
  ## Step 5 — Guide the user
146
145
 
147
146
  The question to ask depends on whether there is actually **something to resume** — i.e. **build
148
- artifacts** (`brief.md`, `site.json`, …) or a **live site** for this domain. A stray `.lock` or
149
- connect-only files are *not* something to resume.
150
-
151
- - **New build** (no build artifacts and either the domain is free **or** it holds only an empty
152
- headless shell or a PocketBase site from onboarding) → just proceed to refine. **Don't ask resume vs start over** —
153
- there's nothing to resume; both would land in the same place. An empty headless shell is not
154
- "something to resume": it has no backend and no content yet, so it's a fresh build that already owns
155
- its website — provision will adopt and swap it. Mention it in one line ("Using the headless site
156
- onboarding already created for this domain."). If a leftover `.lock` is lying around, silently take
157
- it over and continue (optionally mention it in one line).
147
+ artifacts** beyond a brief only, or a **live site** for this domain. A stray `.lock`, connect's files or a brief only are *not*
148
+ something to resume.
149
+
150
+ - **A run paused in provision or content model for a tool restart** (`run-start` printed "continued
151
+ after a tool restart in <stage>/<phase>") → resume at that stage and phase without asking: the user only
152
+ restarted their tool (`run-start` continues a run only when the pause deleted its `.lock`, so Step 1
153
+ finds none). What Steps 1–3 found still corrects the stage. A run paused in connect has nothing to resume yet: the cases below apply.
154
+ - **New build** (brief only, and either the domain is free **or** it holds only an empty headless
155
+ shell or a PocketBase site from onboarding) → just proceed to provision. **Don't ask resume vs
156
+ start over** — there's nothing to resume; both would land in the same place. An empty headless
157
+ shell is not "something to resume": it has no backend and no content yet, so it's a fresh build
158
+ that already owns its website — provision will adopt and swap it. Mention it in one line ("Using
159
+ the headless site onboarding already created for this domain."). If a leftover `.lock` is lying
160
+ around, silently take it over and continue (optionally mention it in one line).
161
+ - **The brief named another backend than the site fixes** (Step 3) → send the run back to refine
162
+ with that backend fixed (`next refine`; refine Step 1, *A fixed backend*). Refine re-confirms the
163
+ plan with the user in one message and writes the brief, then the run returns here and lands in
164
+ one of the other cases.
165
+ - **A live site with a real backend, and a brief only** (built from another machine, so there was no
166
+ workspace) → say what's live and offer **resume** or **iterate**, as below. Treat the brief as what
167
+ the user is asking for.
158
168
  - **Something to resume** (build artifacts exist, or a site exists for the domain **with a real backend
159
169
  installed** — WordPress at `/cms`, a store, a PocketBase backend with build artifacts, or a deployed app) → tell the user plainly what's there
160
170
  and **ask them to choose**, regardless of how old it is (don't guess from timestamps):
@@ -185,8 +195,8 @@ Then:
185
195
 
186
196
  - **Handing straight to the next stage in this same session?** Keep the `.lock` (you are still
187
197
  actively running) and continue.
188
- - **Stopping and returning control to the user?** (e.g. the next stage isn't built yet, or you are
189
- waiting on them.) **Delete the `.lock`** — the session is no longer active, and a leftover lock just
198
+ - **Stopping and returning control to the user?** (e.g. the next stage isn't built yet; waiting for
199
+ an answer is not a stop.) **Delete the `.lock`** — the session is no longer active, and a leftover lock just
190
200
  forces an unnecessary "is another window running?" question on the next run. Always release the lock
191
201
  on a clean stop; it exists only to mark an actively-running session. A stop is still the end of a
192
202
  run: give the final report and save the build report (`09-done`).
@@ -27,7 +27,7 @@ Provision a **Hostinger Ecommerce** backend for `<domain>` and prove it is ready
27
27
  > (Or enable the **Ecommerce** MCP in the Hostinger Connector.) A newly added MCP server only loads
28
28
  > after a restart, so pause the run with *register, restart, resume* from `connect/SKILL.md`: save
29
29
  > state, ask the user to restart the tool and paste the same prompt, and end your turn. Check-state then
30
- > resumes at provision. Never spawn the server yourself or write a JSON-RPC client to reach it.
30
+ > resumes at the stage that paused. Never spawn the server yourself or write a JSON-RPC client to reach it.
31
31
  >
32
32
  > Verify the tools work in-session with a search — e.g. "list stores" →
33
33
  > `ecommerce_stores_list` — before proceeding.
@@ -23,8 +23,8 @@ Two phases around the **instance barrier** (see the top-level `SKILL.md`):
23
23
 
24
24
  **Content subagent: skip this section and start at *Prepare phase*.** Main agent with a subagent
25
25
  tool: don't do the prepare phase yourself (*Content and design at the same time* in the top-level
26
- `SKILL.md`). Ask the image-source question (*Images* below), then launch one background subagent
27
- with the prompt below and go on to design. One subagent keeps the whole site in one voice and leaves
26
+ `SKILL.md`). Take the image source from `brief.md` → *Images* (asking it only when the brief has no
27
+ such section, as *Images* below says), then launch one background subagent with the prompt below and go on to design. One subagent keeps the whole site in one voice and leaves
28
28
  no files to merge.
29
29
 
30
30
  Send the prompt as it is, filling only the `<…>` slots. Add nothing to it: word counts, item counts,
@@ -35,7 +35,7 @@ You are the content subagent of a Hostinger headless build for <domain>. Do cont
35
35
  yourself, start to finish, and skip the section "Prepare in a subagent".
36
36
 
37
37
  Workspace: ~/.hostinger/<domain>/ (brief.md is there). Skill folder: <skill folder>.
38
- Backend: <backend from brief.md>. Image source the user chose: <their answer>.
38
+ Backend: <backend from brief.md>. Image source: <brief.md → Images>.
39
39
 
40
40
  Follow <skill folder>/steps/04-content-model/SKILL.md → "Prepare phase". For the file format: on
41
41
  wordpress, with or without WooCommerce, also <skill folder>/steps/04-content-model/wordpress/SKILL.md
@@ -132,10 +132,12 @@ Guidance:
132
132
 
133
133
  ### Images — generate with Hostinger AI, or source stock from Unsplash
134
134
 
135
- Every article (and every product) needs an image. There are two sources, and **you MUST offer the user
136
- both and let them choose — never pick silently.** State the default for this backend in one line, name
137
- the other option, and proceed on their answer ("you decide" = use the default; a skipped tool result is
138
- not an answer, see *When you ask the user* in the top-level `SKILL.md`):
135
+ Every article (and every product) needs an image. There are two sources, and **the user chooses —
136
+ never pick silently.** Refine offers the choice in its plan confirm, with this backend's default
137
+ named, and records it in `brief.md` → **Images**: use that. Only a brief without an Images section
138
+ (written before refine asked it) leaves the question to you: state the default for this backend in
139
+ one line, name the other option, and proceed on their answer ("you decide" = use the default; a
140
+ skipped tool result is not an answer, see *When you ask the user* in the top-level `SKILL.md`):
139
141
 
140
142
  | Option | Tool | Backends | Needs the live instance? |
141
143
  |---|---|---|---|
@@ -147,10 +149,10 @@ not an answer, see *When you ask the user* in the top-level `SKILL.md`):
147
149
  > is only correct when **the user chose it**, or when **AI generation actually failed** (and then you say
148
150
  > so). Taking stock because it is faster, synchronous, or avoids the async poll is a **defect**, not a
149
151
  > shortcut: the async start → poll → upload-before-expiry flow (Option A below) is the expected work, not
150
- > an optional extra. If you are tempted to skip it "for speed", stop and offer the user the choice instead.
152
+ > an optional extra. If you are tempted to skip it "for speed", stop and ask the user instead.
151
153
 
152
- If you can generate images yourself (some agents can), offer that as a third option; only if the user
153
- picks it, put the files in `media/` (no tool needed). **Record alt text for every image whichever source
154
+ If you can generate images yourself (some agents can), that's a third option, which refine offers;
155
+ only if the user picks it (**Generated by the agent** in the brief), put the files in `media/` (no tool needed). **Record alt text for every image whichever source
154
156
  you use.**
155
157
 
156
158
  **During the prepare wait, write an image brief for each image** into `content-model.md` no matter the
@@ -24,15 +24,15 @@ Write it in this order:
24
24
  root returns 403 until the frontend is deployed").
25
25
 
26
26
  2. **Steps completed.** This table is required on every run, including early stops: never replace
27
- it with prose. Give one row per stage that ran, using the stage numbers and names from the
28
- orchestrator's flow table. Leave out stages that didn't run and name them in the outcome
27
+ it with prose. Give one row per stage that ran, in the order it ran, using the stage numbers
28
+ and names from the orchestrator's flow table. Leave out stages that didn't run and name them in the outcome
29
29
  paragraph instead. A finished WordPress blog build looks like this:
30
30
 
31
31
  | Stage | Result |
32
32
  |---|---|
33
+ | 1 refine | Personal travel blog about coastal towns in the UK; backend: WordPress; images: Hostinger AI. |
33
34
  | connect | Hostinger connector reached over MCP (`@hostinger/mcp` 1.9.2); signed in through the browser login. |
34
- | 1 check state | New build for `harbourlight.blog`; no earlier workspace. |
35
- | 2 refine | Personal travel blog about coastal towns in the UK; backend: WordPress. |
35
+ | 2 check state | New build for `harbourlight.blog`; no earlier workspace. |
36
36
  | 3 provision | Business plan, order 41875230; setup took 6 min; domain, SSL and WordPress checks passed. |
37
37
  | 4 content model | 5 pages, 8 posts, 6 categories, 1 menu, 14 images (Hostinger AI), SEO titles on every page; counts re-read from the REST API. |
38
38
  | 5 design | "Salt & Ink" direction: serif headings, sea-blue accents; `design.md` and logo icon written. |