frontpage-host 0.1.1 → 0.1.2

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/AGENTS.md CHANGED
@@ -17,6 +17,28 @@ frontpage help --json # introspect commands + topics
17
17
 
18
18
  Node.js ≥ 20.
19
19
 
20
+ ## Staging vs production (read this first)
21
+
22
+ Frontpage has two surfaces:
23
+
24
+ | Surface | URL | What it is |
25
+ |---------|-----|------------|
26
+ | **Staging** | `https://<subdomain>.frontpage.host` | Working copy for edits, previews, and review |
27
+ | **Production** | Custom domain (when connected), after **publish** | What end customers see on the live domain |
28
+
29
+ **How changes become visible on staging**
30
+
31
+ - `frontpage push`, `frontpage prompt`, and `frontpage edit` update the site branch and the **staging** surface.
32
+ - After a push or agent run finishes building, changes are visible at `https://<subdomain>.frontpage.host`.
33
+ - There is **no separate “deploy to staging” step** agents must run. Do not treat `frontpage deploy wait` as “going live.” At most it waits for an in-flight build to finish before you open the subdomain to review.
34
+ - `frontpage open` opens the subdomain staging URL.
35
+
36
+ **Production publish is a deliberate promote**
37
+
38
+ - `frontpage publish` copies the current **staging tip** to **production** (custom domain / published site).
39
+ - **Never run `publish` or `unpublish` unless the user explicitly asked**, or the user’s own automation/workflow clearly requires autonomous publishing.
40
+ - Default: finish work on staging, tell the user to review `https://<subdomain>.frontpage.host`, and let **them** publish (or ask you to publish after they approve).
41
+
20
42
  ## Non-interactive auth
21
43
 
22
44
  ```bash
@@ -32,8 +54,8 @@ frontpage doctor --json
32
54
 
33
55
  ## Site IDs
34
56
 
35
- - Always use the **subdomain** (`arbiter`, `asimov-press`).
36
- - Never pass custom domains, FQDNs, or URLs to `use` / `--site`.
57
+ - Always use the **subdomain** (`arbiter`, `asimov-press`) with `use` / `--site`.
58
+ - Never pass custom domains, FQDNs, or URLs as the site id.
37
59
  - Folder state: `.frontpage/state.json` → `{ slug, baseCommitSha }`.
38
60
 
39
61
  ```bash
@@ -44,7 +66,7 @@ frontpage use <subdomain>
44
66
 
45
67
  ## File sync recipe
46
68
 
47
- Allowlisted roots only: `src/`, `public/`, `content/`. Other paths are never pulled/pushed.
69
+ Allowlisted roots only: `src/`, `public/`, `content/`. Other paths never sync (including some platform-owned scaffold files).
48
70
 
49
71
  ```bash
50
72
  frontpage pull
@@ -52,28 +74,29 @@ frontpage pull
52
74
  frontpage diff --json # data.dirty === true when local ≠ remote
53
75
  frontpage push --message "…"
54
76
  # on exit 3 (CAS / active run): frontpage status --json → pull or wait → retry push
55
- frontpage deploy wait
56
- # optional production promote:
57
- frontpage publish --site <subdomain>
77
+ # Review at https://<subdomain>.frontpage.host
78
+ # Do NOT publish unless the user asked.
58
79
  ```
59
80
 
60
81
  Rules:
61
82
 
62
83
  1. **Pull before push** so `baseCommitSha` is set (CAS).
63
84
  2. **Do not push** while an agent run is active (`status` / `runs`).
64
- 3. Push commits to the site branch and triggers staging deploy. **`publish` promotes staging → production.**
85
+ 3. Push updates **staging** (subdomain). Production is unchanged until someone runs `publish`.
65
86
  4. Pushing module markup may auto-activate modules (same as the editor agent).
66
87
  5. Binaries use base64; do not UTF-8 round-trip them.
88
+ 6. Prefer reviewing the subdomain after push; only use `deploy wait` if you need to block until a build finishes.
67
89
 
68
90
  ## Agent prompt loop
69
91
 
70
92
  ```bash
71
- RUN=$(frontpage prompt "make the hero shorter" --json | …) # or bare runId on stdout without --json
72
- frontpage runs wait "$RUN"
73
- # Mid-task continuation is automatic — there is NO `runs continue` in v1.
74
- frontpage deploy wait
93
+ frontpage prompt "make the hero shorter"
94
+ frontpage runs wait # wait for the agent run to finish
95
+ # Review https://<subdomain>.frontpage.host — do not publish unless asked.
75
96
  ```
76
97
 
98
+ Mid-task continuation is automatic. There is **no** `runs continue` in v1.
99
+
77
100
  ## Content / JSON-native commands
78
101
 
79
102
  These already return JSON bodies (wrap further with global `--json` where supported):
@@ -81,21 +104,23 @@ These already return JSON bodies (wrap further with global `--json` where suppor
81
104
  - `usage`, `analytics`, `seo`, `articles`, `settings`, `inbox` (default JSON)
82
105
  - Mutate: `modules enable|disable|archive|config`, `extensions …`
83
106
 
84
- Click-edit (exact single occurrence + deploy), **not** file push:
107
+ Click-edit (exact single occurrence), **not** file push:
85
108
 
86
109
  ```bash
87
110
  frontpage edit --path / --old "exact old" --new "exact new"
88
111
  ```
89
112
 
113
+ `edit` also updates **staging**, same as push. Still do not publish unless asked.
114
+
90
115
  ## History / revert
91
116
 
92
117
  ```bash
93
118
  frontpage history --json
94
- frontpage revert <40-char-sha> --yes # required --yes when non-TTY
119
+ frontpage revert <40-char-sha> --yes # required --yes when non-TTY; only if user asked
95
120
  ```
96
121
 
97
122
  - `S` = staging tip, `P` = production tip.
98
- - Revert creates a **new** commit whose tree matches the target (linear restore).
123
+ - Revert creates a **new** commit whose tree matches the target (linear restore) on the site branch (staging).
99
124
  - Full 40-char SHA only. Refused while an agent run is active.
100
125
 
101
126
  ## Exit codes — what to do next
@@ -129,24 +154,33 @@ Failures with `--json` print the envelope on **stdout** (still use the process e
129
154
 
130
155
  ## Destructive ops — defaults for agents
131
156
 
132
- **Never** run unless the user explicitly asked:
157
+ **Never** run unless the user explicitly asked (or their workflow clearly requires it):
133
158
 
159
+ - `frontpage publish` (promotes staging → **production** / custom domain)
134
160
  - `frontpage unpublish` (takes production offline) — requires `--yes` when non-TTY
135
161
  - `frontpage revert <sha>` — requires `--yes` when non-TTY
136
162
  - `frontpage inbox … --mark-read` (side-effecting)
137
- - Broad `frontpage edit` / settings mutations without a clear request
163
+ - Broad `settings` mutations or mass `edit` without a clear request
138
164
 
139
- `publish` promotes staging to production — confirm intent before running.
165
+ Safe default after finishing work: summarize what changed and give the staging URL for review.
140
166
 
141
- ## Out of v1 (do not invent)
167
+ ## Other nuances agents often miss
142
168
 
143
- `domains*`, `billing*`, `members*`, `suggestions*`, `sites delete|restore`, `runs continue`, MCP, git remotes / clone URLs.
169
+ 1. **CLI site id ≠ public domain.** Target `asimov-press`, not `asimov-press.frontpage.host` or a custom domain.
170
+ 2. **Keys are account-wide.** One key can reach every site the user can access.
171
+ 3. **404 → exit 4** often means “no access / not found,” not only a bad password.
172
+ 4. **Allowlist only.** If a file is not under `src/`, `public/`, or `content/`, the CLI will not sync it. Some scaffold files are platform-owned and refuse CLI read/write.
173
+ 5. **Full-tree push for allowlisted roots.** Local allowlisted files become the intended remote tree for those roots on push.
174
+ 6. **Active-run guard.** Push/revert refuse while an editor agent run is active (exit 3).
175
+ 7. **CAS.** Tip moved since pull → exit 3; pull and retry.
176
+ 8. **No invented v1 commands:** `domains*`, `billing*`, `members*`, `suggestions*`, `sites delete|restore`, `runs continue`, MCP, git remotes / clone URLs.
177
+ 9. **`deploy wait` ≠ publish.** Optional build wait only; staging visibility is the subdomain.
178
+ 10. **Honesty on stubs.** `open --prod` is currently a no-op stub (still opens the subdomain).
144
179
 
145
180
  ## Isolation (hard fence)
146
181
 
147
182
  - API never returns another site’s branch, GitHub tokens, or clone URLs.
148
183
  - Site targeting is subdomain → `site/<slug>` only.
149
- - Non-member site calls → 404 (exit 4) — do not treat as “wrong password” only.
150
184
  - See `frontpage help isolation`.
151
185
 
152
186
  ## Canonical introspection
@@ -155,5 +189,6 @@ Failures with `--json` print the envelope on **stdout** (still use the process e
155
189
  frontpage help
156
190
  frontpage help --json
157
191
  frontpage help sync
192
+ frontpage help agent
158
193
  frontpage doctor --json
159
194
  ```
package/README.md CHANGED
@@ -24,7 +24,8 @@ Requires Node.js ≥ 20.
24
24
  4. `mkdir my-site && cd my-site && frontpage use <subdomain>`
25
25
  5. `frontpage pull` → edit files under `src/`, `public/`, or `content/`
26
26
  6. `frontpage push --message "describe the change"`
27
- 7. `frontpage deploy wait` (staging). Optional: `frontpage publish` (production).
27
+ 7. Review staging at `https://<subdomain>.frontpage.host` (no separate staging-deploy step).
28
+ 8. `frontpage publish` only when you intentionally promote to production.
28
29
 
29
30
  ## Environment
30
31
 
package/dist/registry.js CHANGED
@@ -153,7 +153,10 @@ export const COMMANDS = [
153
153
  summary: "Promote staging to production",
154
154
  usage: "frontpage publish [--site <slug>] [--json]",
155
155
  topics: ["agent"],
156
- dangers: ["Promotes the current staging tip to production"],
156
+ dangers: [
157
+ "Promotes the current staging tip to PRODUCTION (custom domain)",
158
+ "Agents: never run unless the user explicitly asked to publish",
159
+ ],
157
160
  seeAlso: ["unpublish", "deploy"],
158
161
  },
159
162
  {
@@ -161,13 +164,21 @@ export const COMMANDS = [
161
164
  summary: "Take the live site offline (admin)",
162
165
  usage: "frontpage unpublish [--site <slug>] [--yes] [--json]",
163
166
  topics: ["agent"],
164
- dangers: ["Takes production offline", "Requires --yes when stdin is not a TTY"],
167
+ dangers: [
168
+ "Takes production offline",
169
+ "Requires --yes when stdin is not a TTY",
170
+ "Agents: never run unless the user explicitly asked",
171
+ ],
165
172
  },
166
173
  {
167
174
  name: "deploy",
168
- summary: "Wait for active agent deploy to finish",
175
+ summary: "Wait for an in-flight build to finish (not publish)",
169
176
  usage: "frontpage deploy wait [--site <slug>] [--json]",
170
177
  topics: ["agent"],
178
+ flags: [
179
+ "Optional build wait only — staging is https://<subdomain>.frontpage.host",
180
+ "Does NOT promote to production; use publish only when the user asks",
181
+ ],
171
182
  },
172
183
  {
173
184
  name: "usage",
@@ -296,9 +307,11 @@ export const TOPICS = {
296
307
  5. frontpage pull
297
308
  6. Edit files under src/, public/, or content/
298
309
  7. frontpage push --message "…"
299
- 8. frontpage deploy wait # staging
300
- 9. frontpage publish # optional: promote to production
310
+ 8. Review https://<subdomain>.frontpage.host (staging)
311
+ 9. frontpage publish # ONLY if the user asked — promotes to production
301
312
 
313
+ Staging is the subdomain. There is no separate staging-deploy step for agents.
314
+ Never publish/unpublish unless the user explicitly asks.
302
315
  Agents: read AGENTS.md in the npm package; use --json for structured I/O.
303
316
  More: frontpage help auth | sync | agent | content | history | isolation | exit-codes`,
304
317
  auth: `Authentication
@@ -328,16 +341,21 @@ export const TOPICS = {
328
341
  Pushing module markup may auto-activate modules (same as the agent).
329
342
  tokens.ts may be auto-repaired at commit if it would break the build.
330
343
  Binaries use base64 (not utf8-corrupted).
331
- Push updates staging; use frontpage publish to promote production.`,
344
+
345
+ Staging vs production:
346
+ - Push/prompt/edit update STAGING: https://<subdomain>.frontpage.host
347
+ - No separate "deploy to staging" step for agents — review the subdomain after the build.
348
+ - frontpage deploy wait only waits for an in-flight build; it is NOT go-live.
349
+ - frontpage publish promotes staging → production (custom domain). Never publish unless asked.`,
332
350
  agent: `Agent + publish
333
351
  frontpage prompt "make the hero shorter"
334
352
  frontpage runs # latest + active
335
353
  frontpage runs wait [runId]
336
354
  frontpage runs cancel <runId>
337
355
  frontpage runs retry <runId>
338
- frontpage deploy wait
339
- frontpage publish
340
- frontpage unpublish --yes # admin only; --yes required when non-TTY
356
+ frontpage deploy wait # optional: wait for build; NOT publish
357
+ frontpage publish # ONLY if the user asked — production promote
358
+ frontpage unpublish --yes # admin only; never unless asked; --yes when non-TTY
341
359
  frontpage usage
342
360
  frontpage analytics [--days 7]
343
361
  frontpage pages
@@ -345,7 +363,8 @@ export const TOPICS = {
345
363
  frontpage extensions
346
364
 
347
365
  Mid-task continuation is automatic — there is no runs continue.
348
- Do not push while an agent run is active.`,
366
+ Do not push while an agent run is active.
367
+ Default after work: review https://<subdomain>.frontpage.host; do not publish.`,
349
368
  content: `Content
350
369
  frontpage media list|upload <file>
351
370
  frontpage inbox [leads|subscribers|orders|…] [--mark-read] [--csv]
package/llms.txt CHANGED
@@ -6,7 +6,9 @@
6
6
  - Topics: quickstart, auth, sync, agent, content, history, isolation, exit-codes
7
7
  - Auth: mint fp_live_ key in Frontpage UI (Developers); frontpage login KEY or FRONTPAGE_API_KEY
8
8
  - Site id: subdomain only (frontpage use <subdomain>). Not custom domains.
9
- - Sync: allowlist src/ public/ content/; pull → edit → push (CAS baseCommitSha); no push during active agent run
10
- - Staging after push/prompt; frontpage publish promotes to production
9
+ - Staging: https://<subdomain>.frontpage.host — push/prompt/edit update staging; no separate staging deploy step for agents
10
+ - Production: custom domain after frontpage publish — NEVER publish/unpublish unless the user explicitly asks
11
+ - Sync: allowlist src/ public/ content/; pull → edit → push (CAS); no push during active agent run; review on subdomain
11
12
  - Machine: global --json / --quiet; exit 0/2/3/4/5 (see help exit-codes)
13
+ - deploy wait = optional build wait only; it is NOT go-live / publish
12
14
  - No runs continue, domains, billing, members, MCP, or git remotes in v1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontpage-host",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Frontpage CLI — manage your site from the terminal",
5
5
  "type": "module",
6
6
  "bin": {