siteplane 0.1.66 → 0.1.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,151 +1,11 @@
1
1
  # siteplane
2
2
 
3
- **Image-policy preparation:** When the scan includes image fields, `withSiteplane` prepares
4
- Next Image and existing Next-config CSP headers for Siteplane's image route and your website's
5
- `/siteplane-assets/` path. Existing image sources stay in place. Local builds require the same public HTTPS
6
- `SITEPLANE_SITE_ORIGIN` supplied by `setup deploy`. The wrapper adds only those exact patterns: existing
7
- sources, custom loaders and redirect settings remain unchanged. Preflight still flags custom loaders and CSP
8
- in middleware, proxy or app source for explicit delivery checks. Keep existing policies and verify Siteplane
9
- images through the website's actual renderer. This preparation does not authorize hosting.
3
+ Siteplane for Next.js websites: `withSiteplane` for `next.config` and the `siteplane` command for Booking.
10
4
 
11
- Public Siteplane CLI for connected-site setup, field synchronization, Analytics
12
- instrumentation and Booking integration.
5
+ The website connection for content editing returns with the new agent connection (`npx siteplane@latest init`).
6
+ Until then this package serves Booking.
13
7
 
14
- ## Controlled guest review
15
-
16
- After a controlled accountless setup reaches `ready_for_review`, run `siteplane setup review`
17
- in the same website repository. Its protected local installation key opens access to that project's
18
- saved review without creating another site or deployment. Give the one-time link to the user;
19
- they choose **Open review** in their own browser. Do not consume the link on their behalf.
20
- Issue a fresh link only when needed. The URL fragment is a short-lived credential, so do not
21
- write it to source, documentation, analytics or shared logs. Guest review can organize and finish
22
- the setup; activation and account ownership require the later claim step. This entry remains
23
- controlled by the existing beta and launch gates.
24
-
25
- ### Controlled claim confirmation
26
-
27
- When the signed-in review supplies a claim code, run `siteplane setup claim inspect --code <code>`
28
- in the original repository. Show the returned account, workspace and website to the user. After
29
- they explicitly approve that concrete request, run `siteplane setup claim confirm --code <code>
30
- --request <requestId>`. Inspection never confirms automatically. A code alone cannot claim a website;
31
- the command also requires the original local installation key.
32
-
33
- Confirmation saves the receipt in the ignored local credentials file before acknowledging it to
34
- the server. If the response is lost, retry the same code and request. Keep the existing project,
35
- connection and deployment. Claim revokes guest access and preserves only the still-open setup rights;
36
- it does not activate modules or reopen a finished setup. The browser Auth/claim flow is still under
37
- development, and the general accountless entry remains closed.
38
-
39
- ## Initial setup
40
-
41
- Copy the setup prompt in Siteplane, then run its exact one-time command in the
42
- website repository:
43
-
44
- ```bash
45
- npx -y siteplane@<exact-version> setup preflight
46
- npx -y siteplane@<exact-version> init --setup-token <one-time-setup-grant>
47
- npx siteplane setup context
48
- ```
49
-
50
- `init` exchanges the short-lived grant for the run-bound Project Connection and
51
- stores it only in the ignored `.siteplane/credentials.json`. No browser approval
52
- is required. The same connection resumes the open setup and review corrections
53
- until the owner completes or revokes the setup.
54
-
55
- `setup context` returns the single `siteplane.setup-task.v2` task: exact packages, current run,
56
- authorized modules/scopes, separate unchanged user instructions, environment provenance and one next action.
57
- An initial instruction such as `Only prices` does not start a correction workflow. The agent integrates
58
- Siteplane's existing CMS editing layer, preserving the website; it does not build a separate CMS.
59
-
60
- Report observed work with `siteplane setup activity --phase inspecting` (also integrating, deploying,
61
- verifying or repairing). Reports are limited to one per 30 seconds; context polling is not activity.
62
- Optional Analytics preparation uses this same connection with explicit authorization. It grants no
63
- activation, import, reporting, booking or publishing rights. Standalone bootstrap cannot replace an open task.
64
-
65
- `setup prepare` installs the task's exact packages and creates the narrow official runtime integration.
66
- The agent chooses and instruments content, then persists a separate, bounded summary:
67
-
68
- For a direct field ID, put `siteplane.attrs(fieldId, { routeKey })` on the visible
69
- element using the same canonical route pattern as its value call. The value call
70
- does not attach DOM metadata. Missing or mismatched DOM routes block apply and
71
- the Next build; dynamic pages use their pattern, such as `/services/[slug]`.
72
- Direct attrs defaults to `fieldType: "text"`; for longText, link and image,
73
- pass the matching `fieldType` explicitly. The value call does not infer it for attrs.
74
- `setup apply` reports `field_scan.attrs_field_type_mismatch` before any contract write.
75
- This type diagnostic remains a scanner warning for normal website builds.
76
-
77
- ```bash
78
- siteplane setup apply --definition editor-definition.json --selection-summary-file selection.txt
79
- siteplane setup deploy --wait
80
- ```
81
-
82
- Commit only intended source before deploy. The CLI securely transfers its Production environment, adopts or
83
- starts one matching deployment and verifies the actual build and signed runtime. Unchanged resume creates no
84
- new deployment. If the linked project has multiple verified, non-redirecting Production domains, select the
85
- canonical one on the first run with `siteplane setup deploy --wait --production-origin <https-origin>`. The CLI
86
- rejects foreign, redirect, branch and unverified domains, stores the binding and reuses it on resume. A saved
87
- 15-minute provider deadline and operation identity prevent blind retries after response
88
- loss. If that deadline expires after the deploy was requested, rerun the same command: each invocation gets a
89
- bounded 120-second readback of that same operation. A ready result is adopted; a still-running or unreachable
90
- provider remains resumable and never authorizes a second deploy. Uploads use committed source in a temporary
91
- checkout; local credentials are never copied into it.
92
-
93
- For a lost connection, the owner chooses **Replace local connection** in the same open setup. Its new grant
94
- preserves the Site, Run, runtime key, revalidation generation, selected fields and provider admin-session secret.
95
- Completed setup credentials remain closed. Known package/workspace/provider conflicts are diagnosed before
96
- writes; support ranges do not trigger automatic framework or package-manager upgrades.
97
-
98
- ## Accountless start
99
-
100
- Use `setup start` for an explicit user request to integrate a website before creating an account.
101
- Save the user's exact editing instructions in a text file and pass `--instructions-file`; inline
102
- `--instructions` is not supported. Omit the file only when the user asks the agent to choose.
103
-
104
- Before starting, add `.siteplane/credentials.json` to the repository’s `.gitignore`. Start rejects tracked or
105
- unprotected credentials before any provisioning request.
106
-
107
- ```bash
108
- npx -y siteplane@0.1.61 setup start --modules editing --instructions-file instructions.txt
109
- npx -y siteplane@0.1.61 setup context
110
- ```
111
-
112
- Start performs read-only preflight and saves the installation key and original request privately before the
113
- first provisioning call. Select `editing,analytics` only when explicitly requested. Retry in the same directory
114
- with the same request after interruption; configuration without credentials produces a diagnosis, never a silent
115
- replacement project. The returned task carries the provisional assignment and deadline. After verification,
116
- `setup review` opens the saved guest review. The user can create an account or sign in from that review;
117
- inspect and confirm only their concrete claim request in this repository. Claim preserves the review and
118
- returns it to the owner's account; it does not activate editing or analytics.
119
-
120
- ## Approved fields
121
-
122
- Run the exact command from Siteplane's compact apply prompt. It authenticates
123
- with the local Project Connection and reads the approved snapshot without asking
124
- the user to paste its JSON:
125
-
126
- ```bash
127
- siteplane setup fields apply-context --plan-id <plan-id> --snapshot-hash <sha256>
128
- siteplane setup fields apply-context --plan-id <plan-id> --snapshot-hash <sha256> --route / --offset 0
129
- ```
130
-
131
- The first call returns route counts. Route calls return at most 25 approved fields
132
- and a `nextOffset`; continue until it is `null`.
133
-
134
- ## Analytics
135
-
136
- ```bash
137
- siteplane analytics init --agent-client codex
138
- siteplane analytics check
139
- siteplane analytics sync
140
- siteplane analytics test --page-url https://example.com
141
- siteplane analytics import --file provider-export.json
142
- ```
143
-
144
- Analytics commands reuse `siteplane.config.json` and the untracked
145
- `.siteplane/credentials.json` Project Connection. Provider import apply requires
146
- `--apply --confirm-hash <hash> --yes` and an active owner-approved grant.
147
-
148
- ## Booking without Editor setup
8
+ ## Booking
149
9
 
150
10
  ```ts
151
11
  import { withSiteplane } from "siteplane/next";
@@ -153,7 +13,30 @@ export default withSiteplane(nextConfig, { booking: { site: "<immutable-site-id>
153
13
  ```
154
14
 
155
15
  The wrapper adds `/booking/:path*` as a `beforeFiles` rewrite to Siteplane and preserves existing rewrite sections.
156
- Without `siteplane.config.json`, it skips Editor scanning, headers and build proof. Use `<a href="/booking">`
157
- instead of `next/link`; exclude this path from customer middleware. Configure the public booking address in
158
- Siteplane and permit Siteplane/Stripe assets and connections in the customer CSP. `siteplane booking check`
16
+ Booking never runs the Editor scanner or headers, even when `siteplane.config.json` exists. Use
17
+ `<a href="/booking">` instead of `next/link`; exclude this path from customer middleware. Configure the public booking
18
+ address in Siteplane and permit Siteplane/Stripe assets and connections in the customer CSP. `siteplane booking check`
159
19
  verifies the Site ID in `next.config.*`. The public API uses Site ID plus allowed Origin; no raw Booking key is needed.
20
+
21
+ ```bash
22
+ npx siteplane booking init
23
+ npx siteplane booking check
24
+ npx siteplane booking sync
25
+ npx siteplane booking test
26
+ ```
27
+
28
+ `siteplane booking sync` and `siteplane booking test` read the Site ID from `siteplane.booking.json`. The first run
29
+ prints a link and a code and opens the Siteplane approval page, like `gh auth login`; an owner or admin of the website
30
+ checks the code and clicks **Connect**. The agent connection is stored in the user config directory
31
+ (`$SITEPLANE_CONFIG_DIR`, `$XDG_CONFIG_HOME/siteplane`, `%APPDATA%\siteplane` or `~/.config/siteplane`), never in the
32
+ project. Agents without a browser pass the link and code to the user; `--no-browser` skips opening it. A revoked or
33
+ expired connection leads through one new approval.
34
+
35
+ ## Image policy
36
+
37
+ When the scan includes image fields, `withSiteplane` prepares Next Image and existing Next-config CSP headers for
38
+ Siteplane's image route and your website's `/siteplane-assets/` path. Existing image sources stay in place. Builds
39
+ that serve Siteplane images from the website set `SITEPLANE_SITE_ORIGIN` to the exact public HTTPS website origin;
40
+ local fallback-image builds can omit it. The wrapper adds only those exact patterns: existing sources, custom loaders
41
+ and redirect settings remain unchanged. Keep existing policies and verify Siteplane images through the website's
42
+ actual renderer. This preparation does not authorize hosting.