create-freeholder 0.2.0-beta.5 → 0.2.0-beta.6
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/dist/template/.changeset/blog-playground-content.md +4 -0
- package/dist/template/.changeset/blog-wordpress-structure.md +6 -0
- package/dist/template/.changeset/managed-preview-assistant.md +4 -0
- package/dist/template/.changeset/public-beta-6.md +4 -0
- package/dist/template/.github/ISSUE_TEMPLATE/bug_report.yml +1 -1
- package/dist/template/MASTER.md +81 -8
- package/dist/template/README.md +1 -1
- package/dist/template/app/(admin)/admin/assistant/page.tsx +9 -1
- package/dist/template/app/(admin)/admin/blog/PostSettings.tsx +26 -0
- package/dist/template/app/(admin)/admin/blog/[kind]/page.tsx +53 -0
- package/dist/template/app/(admin)/admin/blog/actions.ts +186 -6
- package/dist/template/app/(admin)/admin/blog/comments/page.tsx +25 -0
- package/dist/template/app/(admin)/admin/blog/page.tsx +21 -5
- package/dist/template/app/(admin)/admin/imports/[id]/page.tsx +2 -0
- package/dist/template/app/(admin)/admin/pages/[id]/page.tsx +3 -0
- package/dist/template/app/(admin)/assistant-actions.ts +13 -6
- package/dist/template/app/(public)/[[...slug]]/ReaderComments.tsx +25 -0
- package/dist/template/app/(public)/[[...slug]]/blog-parts.tsx +153 -0
- package/dist/template/app/(public)/[[...slug]]/comment-actions.ts +16 -0
- package/dist/template/app/(public)/[[...slug]]/page.tsx +182 -18
- package/dist/template/app/api/chat/assistant/call/route.ts +35 -0
- package/dist/template/db/migrations/0061_blog_structure.sql +89 -0
- package/dist/template/db/migrations/0062_blog_reader_comments.sql +24 -0
- package/dist/template/db/migrations/meta/_journal.json +14 -0
- package/dist/template/deploy/blog-wordpress-2026-11-07.md +146 -0
- package/dist/template/deploy/docker-selfhost/.env.example +1 -1
- package/dist/template/deploy/docker-selfhost/README.md +3 -2
- package/dist/template/deploy/docker-selfhost/infra/compose.https.yml +1 -1
- package/dist/template/deploy/docker-selfhost/infra/compose.yml +1 -1
- package/dist/template/deploy/f-criteria-matrix.md +74 -0
- package/dist/template/deploy/linux/README.md +1 -1
- package/dist/template/deploy/linux/install.sh +1 -1
- package/dist/template/deploy/managed-preview-assistant.md +99 -0
- package/dist/template/eslint.config.mjs +3 -1
- package/dist/template/locales/ar.json +85 -6
- package/dist/template/locales/en.json +83 -4
- package/dist/template/locales/es.json +83 -4
- package/dist/template/locales/fr.json +85 -6
- package/dist/template/next.config.ts +2 -0
- package/dist/template/package.json +1 -1
- package/dist/template/packages/cli/package.json +1 -1
- package/dist/template/packages/create-freeholder/package.json +1 -1
- package/dist/template/packages/freeholder-app/package.json +1 -1
- package/dist/template/packages/mobile-app/package.json +1 -1
- package/dist/template/packages/plugin-kit/package.json +1 -1
- package/dist/template/packages/sdk/package.json +1 -1
- package/dist/template/packages/sdk/src/generated.ts +177 -9
- package/dist/template/packages/sdk/src/version.ts +1 -1
- package/dist/template/packages/templates/package.json +1 -1
- package/dist/template/proxy.ts +18 -1
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/NOTICE.txt +117 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/audio-output-processor.js +267 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/decoderWorker.min.js +847 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/decoderWorker.min.wasm +0 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/encoderWorker.min.js +1 -0
- package/dist/template/public/managed-assistant/0.1.10/manifest.json +12 -0
- package/dist/template/public/managed-assistant/0.1.10/pm-ai-duplex-client.js +1376 -0
- package/dist/template/scripts/license-headers.mjs +3 -0
- package/dist/template/scripts/verify-wordpress-migration.d.mts +8 -0
- package/dist/template/scripts/verify-wordpress-migration.mjs +105 -0
- package/dist/template/security/adversarial-audit-2026-10-08.md +1 -1
- package/dist/template/src/adapters/ai/types.ts +5 -0
- package/dist/template/src/adapters/paradise/assistant.ts +37 -0
- package/dist/template/src/adapters/paradise/http.ts +4 -3
- package/dist/template/src/core/contract/json-schema.ts +8 -0
- package/dist/template/src/core/demo/playground-inserts.ts +29 -0
- package/dist/template/src/core/demo/playground-policy.ts +9 -0
- package/dist/template/src/core/env.ts +2 -0
- package/dist/template/src/core/http/csp.ts +10 -2
- package/dist/template/src/core/http/csrf-client.ts +10 -0
- package/dist/template/src/core/import/service.ts +217 -12
- package/dist/template/src/core/import/wordpress.ts +80 -15
- package/dist/template/src/core/notifications/service.ts +1 -0
- package/dist/template/src/core/retention/registry.ts +2 -0
- package/dist/template/src/core/search/registry.ts +2 -0
- package/dist/template/src/core/seo/feeds.ts +2 -0
- package/dist/template/src/core/seo/jsonld.ts +46 -2
- package/dist/template/src/core/seo/legacy-proxy.ts +53 -0
- package/dist/template/src/core/seo/meta.ts +10 -7
- package/dist/template/src/core/seo/service.ts +14 -1
- package/dist/template/src/core/update/release-declaration.json +1 -1
- package/dist/template/src/modules/assistant/contract.ts +1 -1
- package/dist/template/src/modules/assistant/limits.ts +3 -0
- package/dist/template/src/modules/assistant/preview.ts +124 -0
- package/dist/template/src/modules/assistant/provider.ts +7 -0
- package/dist/template/src/modules/assistant/service.ts +21 -5
- package/dist/template/src/modules/cms/blocks/PreviewAssistantCall.tsx +176 -0
- package/dist/template/src/modules/cms/blocks/SiteChatClient.tsx +10 -4
- package/dist/template/src/modules/cms/blocks/surfaces.tsx +10 -0
- package/dist/template/src/modules/cms/blog-comments-schema.ts +27 -0
- package/dist/template/src/modules/cms/blog-comments.ts +111 -0
- package/dist/template/src/modules/cms/blog-schema.ts +146 -0
- package/dist/template/src/modules/cms/blog-service.ts +999 -0
- package/dist/template/src/modules/cms/blog.tsx +245 -25
- package/dist/template/src/modules/cms/manifest.ts +7 -1
- package/dist/template/src/modules/cms/read.ts +18 -0
- package/dist/template/src/modules/cms/service.ts +22 -4
- package/dist/template/src/modules/cms/tables.ts +2 -0
- package/dist/template/src/modules/seed/launch.ts +31 -3
- package/dist/template/tests/browser/blog-structure.spec.ts +69 -0
- package/dist/template/tests/core/analytics-consent.test.ts +1 -1
- package/dist/template/tests/core/blog-playground.test.ts +106 -0
- package/dist/template/tests/core/blog-structure-comments.test.ts +166 -0
- package/dist/template/tests/core/csp.test.ts +1 -1
- package/dist/template/tests/core/internal-services.test.ts +4 -0
- package/dist/template/tests/core/legacy-redirect-proxy.test.ts +59 -0
- package/dist/template/tests/core/locale-routing.test.ts +1 -1
- package/dist/template/tests/core/playground-cache.test.ts +1 -1
- package/dist/template/tests/core/playground.test.ts +3 -3
- package/dist/template/tests/core/preview-assistant-call.test.ts +88 -0
- package/dist/template/tests/core/private-preview-webhooks.test.ts +1 -1
- package/dist/template/tests/core/private-preview.test.ts +1 -1
- package/dist/template/tests/core/proxy-locale.test.ts +1 -1
- package/dist/template/tests/core/sdk-schema.test.ts +20 -0
- package/dist/template/tests/core/seo.test.ts +1 -1
- package/dist/template/tests/core/site-chat-client.test.ts +50 -0
- package/dist/template/tests/core/wordpress-import-flow.test.ts +81 -18
- package/dist/template/tests/core/wordpress-import.test.ts +25 -12
- package/dist/template/tests/core/wordpress-migration-verification.test.ts +37 -0
- package/dist/template/tests/modules/preview-assistant.test.ts +164 -0
- package/dist/template-manifest.json +349 -139
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
---
|
|
2
|
+
"freeholder": patch
|
|
3
|
+
---
|
|
4
|
+
The public playground now lets visitors save blog authors, categories, tags and post settings, create posts and moderate demo comments through its existing content permissions. Small page, author and taxonomy limits keep the shared demo bounded; an inline tag batch that would fill it rolls back as a whole. Concurrent writers cannot take the same remaining taxonomy capacity.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
"freeholder": minor
|
|
3
|
+
---
|
|
4
|
+
Organize blog posts with categories, tags and guest or account-linked authors, and manage moderated reader comments from the owner dashboard. WordPress imports now create those records, preserve original post addresses, full search titles, descriptions, post dates and supported search/social metadata, and carry approved and held reader comments into the moderation queue. Reader email stays private and participates in contact merge, export and erasure.
|
|
5
|
+
|
|
6
|
+
Old query-ID and attachment links receive permanent redirects when an import is published; date archives and legacy pagination remain usable. Redirects resolve directly to the final destination before a trailing slash is removed. The import report records source features that still need review before DNS cutover, including the reserved member-feed path and metadata absent from a WordPress export.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
---
|
|
2
|
+
"freeholder": minor
|
|
3
|
+
---
|
|
4
|
+
PM-hosted previews can opt into a managed AI assistant with launch-spec version 3. Text stays on the existing chat transcript and respects local and managed budgets; approved voice and video use the shared call transport with visitor-bound queueing, leases and End. Owners can switch it off, select approved talent and set a daily USD cap. Existing version 1 and 2 launch specs keep their behavior.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
---
|
|
2
|
+
"freeholder": patch
|
|
3
|
+
---
|
|
4
|
+
Publish 0.2.0-beta.6 with blog authors, categories, tags, moderated reader comments and WordPress migration verification. Imported titles, dates, supported search/social metadata and old addresses remain reviewable before cutover, with rollback and contact privacy controls. This beta also carries the separately reviewed Paradise Modern managed preview assistant consumer, off by default; text fallback and scoped server-only call transport do not establish talent clearance or real-call acceptance. The Linux installers, Docker examples, platform, SDK and workspace packages all name this beta. Active development, not a release candidate; source-specific migration acceptance and live-provider qualification remain open.
|
package/dist/template/MASTER.md
CHANGED
|
@@ -2095,8 +2095,9 @@ diff, then stage and commit a reversible import. Nothing is published and DNS
|
|
|
2095
2095
|
never changes merely because the crawler finished.
|
|
2096
2096
|
|
|
2097
2097
|
- **WordPress is the first importer, and the most complete:** the WXR export
|
|
2098
|
-
path brings pages
|
|
2099
|
-
|
|
2098
|
+
path brings pages and posts at their original paths, including the home
|
|
2099
|
+
page and dated post permalinks; explicit blog metadata makes posts appear
|
|
2100
|
+
in the listing without moving them. It also brings attachments into
|
|
2100
2101
|
the media library through the ordinary upload pipeline (pinned SSRF-safe
|
|
2101
2102
|
download, content-sniffed type, size limit, AVIF/WebP renditions, alt text
|
|
2102
2103
|
and source-URL provenance kept, body captions kept as text), body images
|
|
@@ -2105,11 +2106,15 @@ never changes merely because the crawler finished.
|
|
|
2105
2106
|
publish). Original URLs either survive or receive explicit `Redirect` rows.
|
|
2106
2107
|
The REST path covers pages and posts with dates, Yoast fields and embedded
|
|
2107
2108
|
terms; it carries no attachment list, so only same-site body images are
|
|
2108
|
-
fetched.
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2109
|
+
fetched. Categories, tags and authors become real blog records; ordinary
|
|
2110
|
+
WXR reader comments preserve moderation state, dates and available parentage.
|
|
2111
|
+
Replacing live content stages changed blog membership and comments until
|
|
2112
|
+
publication; rollback restores prior metadata and retained comment history.
|
|
2113
|
+
The report keeps remaining uncertainty explicit: nested menus, reserved
|
|
2114
|
+
member-feed collisions, orphan attachments and metadata absent from WXR
|
|
2115
|
+
require source-crawl review (C2.27–C2.29, C3.22 and C3.46 remain open until
|
|
2116
|
+
their acceptance evidence is complete). An export file of up to 100 MB is
|
|
2117
|
+
reserved, sent in 4 MB chunks to
|
|
2113
2118
|
an import-only route that stores them in private object storage, and read
|
|
2114
2119
|
back as a stream; the 1 MB JSON body limit and the request proxy's buffer
|
|
2115
2120
|
stay as they are for every other route.
|
|
@@ -4244,6 +4249,12 @@ project without silent telemetry, and ready to carry money.
|
|
|
4244
4249
|
|
|
4245
4250
|
- [x] **C1.38** Provide a public, disposable shared playground on a separate database and network: restricted visitor sessions, prominent reset/privacy notice, blocked privileged operations and external delivery, hourly reset, bounded resources, and a live demo entry link. Prove content edits, denied sensitive actions, reset recovery, and separation from the production instance.
|
|
4246
4251
|
(Checked 2026-09-27. The isolated playground base (own compose project, database container and internal-only networks; synthetic visitor entry; mutation allow-list policy) is hardened to the full contract. **Restricted visitor sessions:** `src/core/demo/playground.ts` issues sessions only for the synthetic, passwordless `visitor@playground.invalid` principal in the grant-less `playground` role with a one-hour expiry; `tests/core/playground.test.ts` proves the resolved session's grants stay inside `PLAYGROUND_MANAGE`/`PLAYGROUND_VIEW` with manage only on content modules, that no credential flow (`auth.login`) can start from it, and that role creation, staff invitations, host updates, mail test sends, uploads, SMS, payment and settings mutations are refused *server-side* with `permission` — the refusal lives in `authorizeInput` (`src/core/service.ts`), so the admin UI, REST API and MCP hit the same wall, and the test calls the services directly as the playground principal. **Reset/privacy notice:** the root-layout banner (`app/layout.tsx`, key `playground.banner`) rides every playground surface and the `/playground` entry page (`app/playground/page.tsx`, key `playground.limits`) states the hourly reset and the no-personal-information rule, in all four locale catalogs; the demo also serves `Disallow: /` robots. **Blocked external delivery:** `playgroundBlocksExternalDelivery` (`src/core/demo/playground-policy.ts`) fails closed at the three live choke points — `deliverQueuedMail` (`src/core/mail/service.ts`), `messaging.sendSms` (`src/core/messaging/sms.ts`) and the webhook sweep (`src/core/webhooks/deliver.ts`) — so background jobs running as `system` (reminders, compliance replies, queued webhooks) cannot send mail/SMS/webhooks even though the mutation allow-list never covered them; the same test proves each refusal carries the playground reason while a playground-off control takes the ordinary path, and the container gate proves blocked egress on the built image. **Hourly reset:** `deploy/docker-selfhost/playground/reset.sh` recreates the disposable project and is driven hourly by `freeholder-playground-reset.timer`; `tests/core/playground.test.ts` ("playground separation and reset recovery") simulates that cycle (fresh database + migrate + the same boot phases `instrumentation.node.ts` runs) and proves reset recovery: the old visitor session no longer validates, visitor pages are gone, the sample site is reinstalled to the same page count, and a new visitor can edit again. **Bounded resources:** uploads are refused outright (allow-list), all visitor mutations share a 300-per-minute ceiling (`enforceRateLimit`, `src/core/service.ts`), and per-surface row caps (`PLAYGROUND_ROW_CAPS` + `enforcePlaygroundRowCap`) bound pages, sections, forms, contacts, products, notes and tasks; the exact bound (299 further mutations after entry, then refusal; contacts capped at the declared limit while pages still accept edits) is asserted in `tests/core/playground.test.ts`. **Separation:** the playground is its own compose project with its own database container, tmpfs volumes and internal-only networks (`deploy/docker-selfhost/playground/compose.yml`), and the same file proves it on a live cluster: a production-shaped database and a playground database on distinct `DATABASE_URL`s, the playground flag failing closed ("disposable database") against real accounts, the synthetic pair the only users the playground database ever holds, and visitor sessions/content never appearing in the production database. **Live demo entry link:** `FREEHOLDER_PLAYGROUND_URL` renders the "Try the live demo" banner link on a main site (`app/layout.tsx`). **Browser proof:** `tests/browser/playground.spec.ts` (config `playwright.playground.config.ts`, `pnpm test:playground`) drives Chromium through entry, the notice, a real editor edit + publish, three privileged API denials as the visitor (staff invitation, mail test send, upload staging — each 403 with the playground message), the reset (session dead → `/playground` redirect, visitor page 404, reseeded sample back, re-entry and editing restored); CI's `scripts/playground-gate.sh` proves boot, sign-in, editor render and blocked egress on the built container. **F04** entry page + root banner: `app/playground/page.tsx`, `app/layout.tsx`. **F05** one refusal across every projection via the service choke point `src/core/service.ts`; container entry exercised over HTTP by `scripts/playground-gate.sh`. **F07** threat model and bounds: `src/core/demo/playground-policy.ts`, `tests/core/playground.test.ts`. **F09** hourly reset job `deploy/docker-selfhost/playground/reset.sh` + `freeholder-playground-reset.timer`, recovery proof in the same file. **F12** the browser journey composes entry → edit → publish → denial → reset → re-entry: `tests/browser/playground.spec.ts`.)
|
|
4252
|
+
Source-review follow-up 2026-11-07, owner CMS/kernel: the existing page cap
|
|
4253
|
+
runs before `createPage` enters its transaction. The new author/term guard
|
|
4254
|
+
and taxonomy concurrency regression do not qualify concurrent page growth.
|
|
4255
|
+
A scoped follow-up must reproduce that page race, serialize all page
|
|
4256
|
+
insertion paths against shared capacity, and obtain deployed acceptance.
|
|
4257
|
+
No concurrent page-overflow incident is claimed from this source review.
|
|
4247
4258
|
Audit follow-up 2026-10-22 (hands-on audit of demo.freeholder.ai): the
|
|
4248
4259
|
playground was empty where evaluators look and its menu read "Locations".
|
|
4249
4260
|
**Menu:** `cms.ensureDefaults` moved a header menu into a nav section that
|
|
@@ -4889,6 +4900,53 @@ human, collaboratively, without code, lock-in markup or accidental publication.
|
|
|
4889
4900
|
- [x] **C2.26** Deliver a public blog index with published post discovery, pagination, locale-aware links and metadata, an editable index block and an owner publish workflow. Drafts and gated bodies remain private.
|
|
4890
4901
|
*(Closed 2026-10-14 against `C2.26` on `main` (`f9b155be`, released as 0.2.0-beta.3 and live on freeholder.ai). Evidence: `tests/modules/customer-surfaces.test.ts` (published-only listing, drafts and working copies hidden, page 2 pagination, reviewed fr translation) and `tests/browser/customer-surfaces.spec.ts` (owner writes and publishes at /admin/blog; post appears on /blog only after publish; Axe light/dark); /blog serves 200 with a canonical link; scope and limits in `deploy/customer-surfaces-2026-10-07.md`; F01–F12 rows in `deploy/f-criteria-matrix.md`. **F04** `app/(admin)/admin/blog/page.tsx` and `/blog`. **F05** `cms.listBlogPosts` in `src/modules/cms/blog.tsx`, projected to HTTP/MCP and `packages/sdk/src/generated.ts`. **F07** customer ownership and privacy in `tests/modules/customer-surfaces.test.ts`. **F09** provider and deployment limits recorded in `deploy/customer-surfaces-2026-10-07.md`. **F12** `tests/browser/customer-surfaces.spec.ts` composed journey. Live payment-provider settlement stays with C11.05.)*
|
|
4891
4902
|
|
|
4903
|
+
- [ ] **C2.27** Blog categories and tags: hierarchical categories, flat tags,
|
|
4904
|
+
owner CRUD, post assignment, public archive pages, sitemap and slug-move
|
|
4905
|
+
redirects through the same scoped services on UI, HTTP and MCP.
|
|
4906
|
+
- [ ] **C2.28** Blog authors: account-linked or guest profiles, private email,
|
|
4907
|
+
public bylines/bios and author archives; preserve WordPress authors, terms,
|
|
4908
|
+
post dates and exact archive paths at import. Owner administration and
|
|
4909
|
+
four-locale labels are required before checking this item.
|
|
4910
|
+
- [ ] **C2.29** Public blog comments: moderated threads with owner controls,
|
|
4911
|
+
spam/honeypot and rate limits, unified contacts resolution/merge/privacy,
|
|
4912
|
+
notifications and WordPress comment import. Never expose a comment email.
|
|
4913
|
+
*(Implementation and qualification in progress 2026-11-07; owner: CMS/importer.
|
|
4914
|
+
Reproductions: a live replacement exposed imported post metadata before
|
|
4915
|
+
cutover; direct public metadata/comment queries could bypass a registered
|
|
4916
|
+
publication veto; republishing reset an imported original date. Peer review
|
|
4917
|
+
natively reproduced a same-slug locale row authorizing another vetoed ID,
|
|
4918
|
+
and found post-to-ordinary-page replacement retaining the old blog marker.
|
|
4919
|
+
Exact public page IDs now authorize reads, and kind changes hide retained
|
|
4920
|
+
comment history at cutover while preserving rollback. The production-build
|
|
4921
|
+
browser journey also reproduced a 500 on legacy redirects when CSP was
|
|
4922
|
+
written to native immutable redirect headers; the adapter now constructs a
|
|
4923
|
+
mutable framework response before applying the security policy; the HTTP
|
|
4924
|
+
harness resolves Next’s valid relative Location before checking the exact
|
|
4925
|
+
destination. Full CI also caught missing new-table policy decisions: reader
|
|
4926
|
+
comments now explicitly stay in their scoped moderation queue and page/privacy
|
|
4927
|
+
retention lifecycle; playground submission has a 200-row cap plus shared
|
|
4928
|
+
contact/client limits.
|
|
4929
|
+
A subsequent real-session regression also found the advertised editable
|
|
4930
|
+
playground blog forms still refused scoped blog saves, and its create form
|
|
4931
|
+
attempted operator-only bootstrap. Explicit content mutations now use bounded
|
|
4932
|
+
page/author/term stores; playground creation reuses startup-seeded chrome.
|
|
4933
|
+
A shared transaction-scoped insert guard counts inline tag batches and
|
|
4934
|
+
serializes concurrent creators; an over-limit batch rolls back atomically.
|
|
4935
|
+
`tests/core/blog-playground.test.ts` exercises the real server action with
|
|
4936
|
+
a genuine disposable visitor session and verifies moderation and caps.
|
|
4937
|
+
Deployed demo acceptance remains open. Redirect coverage is in
|
|
4938
|
+
`tests/core/legacy-redirect-proxy.test.ts`. Reusable
|
|
4939
|
+
fixes stage replacement metadata/comments until publication, reuse the
|
|
4940
|
+
shared published-page resolver, retain first publication dates and restore
|
|
4941
|
+
rollback dates/working copies. Regression evidence:
|
|
4942
|
+
`tests/core/wordpress-import-flow.test.ts`,
|
|
4943
|
+
`tests/core/blog-structure-comments.test.ts` and
|
|
4944
|
+
`tests/core/wordpress-migration-verification.test.ts`. The browser's first
|
|
4945
|
+
run reached moderation but its status selector also matched the filter nav;
|
|
4946
|
+
the harness now selects the combobox by role. Production deployment and
|
|
4947
|
+
deployed acceptance remain pending; operational limits and all evidence
|
|
4948
|
+
are recorded in `deploy/blog-wordpress-2026-11-07.md`.)*
|
|
4949
|
+
|
|
4892
4950
|
### 43.8 C3 — Living contract, plugins, packages, and portable operation
|
|
4893
4951
|
|
|
4894
4952
|
#### One generated platform contract
|
|
@@ -5173,7 +5231,7 @@ human, collaboratively, without code, lock-in markup or accidental publication.
|
|
|
5173
5231
|
acceptance remain open.
|
|
5174
5232
|
- [x] **C3.20** Add semantic platform/plugin/API versions, compatibility
|
|
5175
5233
|
reporting and a truthful instance version in health, admin, CLI and contract.
|
|
5176
|
-
(Platform and packages are `0.2.0-beta.
|
|
5234
|
+
(Platform and packages are `0.2.0-beta.6`; SDK `PLATFORM_VERSION` is stamped from
|
|
5177
5235
|
`package.json`. Health, OpenAPI, Doctor, provenance, catalogue compatibility
|
|
5178
5236
|
and admin chrome report that same string. `.github/workflows/publish-packages.yml`
|
|
5179
5237
|
publishes packed tarballs on a matching `vX.Y.Z` tag; `scripts/release-packages.mjs`
|
|
@@ -5237,6 +5295,15 @@ human, collaboratively, without code, lock-in markup or accidental publication.
|
|
|
5237
5295
|
the generic sitemap/RSS/Atom/HTML importers still produce a heading plus one
|
|
5238
5296
|
`html` block with no media or redirects; the `archive` kind has no archive
|
|
5239
5297
|
reader of its own.)*
|
|
5298
|
+
*(Update 2026-11-07: C2.27–C2.29/C3.46 add real taxonomy/author records,
|
|
5299
|
+
moderated WXR comment import, original post/home paths and dates, one-hop
|
|
5300
|
+
query/attachment redirects and URL/metadata verification. This supersedes
|
|
5301
|
+
the earlier checkpoint's taxonomy/author/comment and post-relocation limits;
|
|
5302
|
+
the remaining nested-menu, body/item-cap, pasted REST, generic importer and
|
|
5303
|
+
archive-reader limits still keep C3.22 open. Code and source-crawl limits:
|
|
5304
|
+
`src/core/import/service.ts`, `src/core/import/wordpress.ts`,
|
|
5305
|
+
`deploy/blog-wordpress-2026-11-07.md`; composed regressions:
|
|
5306
|
+
`tests/core/wordpress-import-flow.test.ts`.)*
|
|
5240
5307
|
- [x] **C3.23** Build the owner import studio and resumable run ledger:
|
|
5241
5308
|
discover → map → staged preview/diff → conflict review → commit → reconcile
|
|
5242
5309
|
counts/links/SEO/accessibility → reversible batch → approved publish/cutover,
|
|
@@ -5814,6 +5881,12 @@ deployments are portable, testable and incapable of silently forking the truth.
|
|
|
5814
5881
|
recorded in the pull request. The tarballs reach a release only when the
|
|
5815
5882
|
next version is tagged.)*
|
|
5816
5883
|
|
|
5884
|
+
- [ ] **C3.45** — Managed preview assistant: launch-spec v3 preserves v1/v2 compatibility; PM-hosted previews use server-only scoped keys, cleared SFW Canon assets and revocation, AI/no-endorsement disclosure, owner settings and caps, visitor-bound queued voice/video with shared PM duplex transport and leases, and the existing assistant transcript for text; no chatbot age gate. Qualify the consumer, PM backend, deployed text fallback and a real approved call before closing. Peer source integration fixes include localized Contact media policy with controls suppressed elsewhere and existing signed-in chat text/assistant/End CSRF headers; mounted HTTP-guard regressions and source details live in deploy/managed-preview-assistant.md. Hosted shard19/26 native reproductions also qualify shared object-union MCP/HTTP/SDK projection and explicit playground provider/caption refusals.
|
|
5885
|
+
- [ ] **C3.46** SEO-safe WordPress migration: original URLs or single-hop301s,
|
|
5886
|
+
query-ID/feed/archive/attachment URL accounting, original SEO metadata,
|
|
5887
|
+
sitemap/canonical/hreflang validation and an exportable URL/reconciliation
|
|
5888
|
+
report. Publishing is explicit; imported drafts remain private.
|
|
5889
|
+
|
|
5817
5890
|
### 43.9 C4 — Safe agent workforce, connections, scheduling, and briefing
|
|
5818
5891
|
|
|
5819
5892
|
#### Workforce completion
|
package/dist/template/README.md
CHANGED
|
@@ -10,7 +10,7 @@ replaces the stack with one self-hosted platform where a contact is **one
|
|
|
10
10
|
record**: their bookings, orders, quotes, gallery access, messages, and email
|
|
11
11
|
history all hang off one CRM timeline.
|
|
12
12
|
|
|
13
|
-
> **Status: 0.2.0-beta.
|
|
13
|
+
> **Status: 0.2.0-beta.6, in active development; no stable release is published.**
|
|
14
14
|
> This is not a release candidate. The implemented platform is undergoing
|
|
15
15
|
> final release acceptance. Independent
|
|
16
16
|
> security review, real provider settlement, specification reconciliation and
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
scopes,
|
|
44
44
|
settings,
|
|
45
45
|
turns,
|
|
46
|
+
managedDetails,
|
|
46
47
|
} from "@/modules/assistant/service";
|
|
47
48
|
import { getT } from "../../../i18n";
|
|
48
49
|
import { requireStaffActor } from "../guard";
|
|
@@ -89,9 +90,10 @@ export default async function AssistantPage({
|
|
|
89
90
|
domainOrNull(knowledgeGapList.call({ status: "open" }, actor)),
|
|
90
91
|
searchParams,
|
|
91
92
|
]);
|
|
93
|
+
const managed = current?.provider === "paradise" ? await domainOrNull(managedDetails.call({}, actor)) : null;
|
|
92
94
|
|
|
93
95
|
const locale = business?.defaultLocale ?? "en";
|
|
94
|
-
const currency = business?.baseCurrency ?? "USD";
|
|
96
|
+
const currency = current?.provider === "paradise" ? "USD" : business?.baseCurrency ?? "USD";
|
|
95
97
|
const money = (cents: number) => formatMoney(cents, currency, locale);
|
|
96
98
|
const when = (value: Date | string) =>
|
|
97
99
|
new Intl.DateTimeFormat(locale, {
|
|
@@ -176,6 +178,12 @@ export default async function AssistantPage({
|
|
|
176
178
|
</label>
|
|
177
179
|
|
|
178
180
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
181
|
+
{current.provider === "paradise" && <Field label={t("assistant.managed.talent")} htmlFor="assistant-managed-talent" hint={t("assistant.managed.clearance")}>
|
|
182
|
+
<Select id="assistant-managed-talent" name="managedTalent" defaultValue={managed?.settings.talentSlug ?? "sienna-rodriguez"}>
|
|
183
|
+
{!managed?.talent.some(talent => talent.slug === "sienna-rodriguez") && <option value="sienna-rodriguez">{t("assistant.managed.textFallback")}</option>}
|
|
184
|
+
{managed?.talent.map(talent => <option key={talent.slug} value={talent.slug}>{talent.name}</option>)}
|
|
185
|
+
</Select>
|
|
186
|
+
</Field>}
|
|
179
187
|
<Field
|
|
180
188
|
label={t("assistant.field.provider")}
|
|
181
189
|
htmlFor="assistant-provider"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (C) 2026 Tony Aly
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import type { Actor } from "@/core/service";
|
|
4
|
+
import { getPostMeta, listAuthors, listTerms } from "@/modules/cms/blog-service";
|
|
5
|
+
import { Button, Field, Input, Select } from "@/ui/primitives";
|
|
6
|
+
import { getT } from "../../../i18n";
|
|
7
|
+
import { savePostSettingsAction } from "./actions";
|
|
8
|
+
|
|
9
|
+
export async function BlogPostSettings({ pageId, actor }: { pageId: string; actor: Actor }) {
|
|
10
|
+
const [meta, authors, terms, t] = await Promise.all([
|
|
11
|
+
getPostMeta.call({ pageId }, actor), listAuthors.call({}, actor), listTerms.call({}, actor), getT(),
|
|
12
|
+
]);
|
|
13
|
+
return <section className="rounded-lg border border-rule bg-surface p-6" aria-labelledby="post-settings-title">
|
|
14
|
+
<h2 id="post-settings-title" className="text-lg font-semibold">{t("blog.postSettings")}</h2>
|
|
15
|
+
<form action={savePostSettingsAction} className="mt-4 grid gap-4">
|
|
16
|
+
<input type="hidden" name="pageId" value={pageId} />
|
|
17
|
+
<label className="flex items-center gap-2"><input type="checkbox" name="isPost" defaultChecked={meta.isPost} />{t("blog.isPost")}</label>
|
|
18
|
+
<Field label={t("blog.author")} htmlFor="post-author"><Select id="post-author" name="authorId" defaultValue={meta.authorId ?? ""}><option value="">{t("blog.none")}</option>{authors.map(author => <option key={author.id} value={author.id}>{author.name}</option>)}</Select></Field>
|
|
19
|
+
<fieldset><legend>{t("blog.categories")}</legend>{terms.filter(term => term.taxonomy === "category").map(term => <label key={term.id} className="mt-2 flex items-center gap-2"><input type="checkbox" name="categoryIds" value={term.id} defaultChecked={meta.categoryIds.includes(term.id)} />{term.name}</label>)}</fieldset>
|
|
20
|
+
<Field label={t("blog.tags")} htmlFor="post-tags"><Input id="post-tags" name="tags" defaultValue={terms.filter(term => meta.tagIds.includes(term.id)).map(term => term.name).join(", ")} /></Field>
|
|
21
|
+
<input type="hidden" name="commentsSetting" value="1" />
|
|
22
|
+
<label className="flex items-center gap-2"><input type="checkbox" name="commentsEnabled" defaultChecked={meta.commentsEnabled} />{t("blog.commentsEnabled")}</label>
|
|
23
|
+
<Button type="submit">{t("blog.save")}</Button>
|
|
24
|
+
</form>
|
|
25
|
+
</section>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Copyright (C) 2026 Tony Aly
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// Blog taxonomy and guest-author administration (C2.27/C2.28).
|
|
4
|
+
import { notFound } from "next/navigation";
|
|
5
|
+
import { authorAccounts, listAuthors, listTerms } from "@/modules/cms/blog-service";
|
|
6
|
+
import { Button, Field, Input, Select } from "@/ui/primitives";
|
|
7
|
+
import { getT } from "../../../../i18n";
|
|
8
|
+
import { requireStaffActor } from "../../guard";
|
|
9
|
+
import { deleteAuthorAction, deleteTermAction, saveAuthorAction, saveTermAction } from "../actions";
|
|
10
|
+
|
|
11
|
+
export const dynamic = "force-dynamic";
|
|
12
|
+
export default async function BlogDirectory({ params, searchParams }: {
|
|
13
|
+
params: Promise<{ kind: string }>;
|
|
14
|
+
searchParams: Promise<{ edit?: string; error?: string; saved?: string }>;
|
|
15
|
+
}) {
|
|
16
|
+
const { kind } = await params;
|
|
17
|
+
if (!["categories", "tags", "authors"].includes(kind)) notFound();
|
|
18
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
19
|
+
const [t, query] = await Promise.all([getT(), searchParams]);
|
|
20
|
+
const taxonomy = kind === "tags" ? "tag" : "category";
|
|
21
|
+
const terms = kind === "authors" ? [] : await listTerms.call({ taxonomy }, actor);
|
|
22
|
+
const authors = kind === "authors" ? await listAuthors.call({}, actor) : [];
|
|
23
|
+
const accounts = kind === "authors" ? await authorAccounts.call({}, actor) : [];
|
|
24
|
+
const term = terms.find(row => row.id === query.edit);
|
|
25
|
+
const author = authors.find(row => row.id === query.edit);
|
|
26
|
+
const current = author ?? term;
|
|
27
|
+
const seo = (current?.seo ?? {}) as { title?: string; description?: string; noindex?: boolean };
|
|
28
|
+
return <div className="grid max-w-3xl gap-6">
|
|
29
|
+
<a className="underline" href="/admin/blog">{t("blog.title")}</a>
|
|
30
|
+
<h1 className="text-2xl font-semibold">{t(`blog.${kind}`)}</h1>
|
|
31
|
+
{query.error ? <p role="alert">{t("common.somethingWentWrong")}</p> : null}
|
|
32
|
+
{query.saved ? <p role="status">{t("blog.saved")}</p> : null}
|
|
33
|
+
<form action={kind === "authors" ? saveAuthorAction : saveTermAction} className="grid gap-4 rounded-lg border border-rule bg-surface p-6">
|
|
34
|
+
{current ? <input type="hidden" name="id" value={current.id} /> : null}
|
|
35
|
+
<input type="hidden" name="taxonomy" value={taxonomy} />
|
|
36
|
+
<Field label={t("blog.name")} htmlFor="name"><Input id="name" name="name" defaultValue={current?.name} required maxLength={200} /></Field>
|
|
37
|
+
<Field label={t("cms.field.slug")} htmlFor="slug"><Input id="slug" name="slug" defaultValue={current?.slug} pattern="[a-z0-9]+(-[a-z0-9]+)*" /></Field>
|
|
38
|
+
<Field label={t(kind === "authors" ? "blog.bio" : "blog.description")} htmlFor="description"><textarea className="min-h-24 w-full rounded-md border border-rule bg-surface px-3 py-2 text-ink" id="description" name={kind === "authors" ? "bio" : "description"} defaultValue={author?.bio ?? term?.description ?? ""} maxLength={4000} /></Field>
|
|
39
|
+
{kind === "authors" ? <Field label={t("blog.privateEmail")} htmlFor="email"><Input id="email" name="email" type="email" autoComplete="off" defaultValue={author?.email ?? ""} maxLength={320} /></Field> : null}
|
|
40
|
+
{kind === "authors" ? <Field label={t("blog.linkedAccount")} htmlFor="userId"><Select id="userId" name="userId" defaultValue={author?.userId ?? ""}><option value="">{t("blog.guestAuthor")}</option>{author?.userId && !accounts.some(account => account.id === author.userId) ? <option value={author.userId}>{author.name}</option> : null}{accounts.map(account => <option key={account.id} value={account.id}>{account.email}</option>)}</Select></Field> : null}
|
|
41
|
+
{kind === "categories" ? <Field label={t("blog.parent")} htmlFor="parentId"><Select id="parentId" name="parentId" defaultValue={term?.parentId ?? ""}><option value="">{t("blog.none")}</option>{terms.filter(row => row.id !== term?.id).map(row => <option key={row.id} value={row.id}>{row.name}</option>)}</Select></Field> : null}
|
|
42
|
+
<Field label={t("blog.seoTitle")} htmlFor="seoTitle"><Input id="seoTitle" name="seoTitle" defaultValue={seo.title} maxLength={200} /></Field>
|
|
43
|
+
<Field label={t("blog.seoDescription")} htmlFor="seoDescription"><textarea className="min-h-24 w-full rounded-md border border-rule bg-surface px-3 py-2 text-ink" id="seoDescription" name="seoDescription" defaultValue={seo.description} maxLength={320} /></Field>
|
|
44
|
+
<label className="flex items-center gap-2"><input type="checkbox" name="noindex" defaultChecked={seo.noindex} />{t("blog.noindex")}</label>
|
|
45
|
+
<Button type="submit">{t("blog.save")}</Button>
|
|
46
|
+
</form>
|
|
47
|
+
<ul className="grid list-none gap-3 p-0">{[...terms, ...authors].map(row => <li key={row.id} className="flex flex-wrap items-center justify-between gap-3 border-b border-rule pb-3">
|
|
48
|
+
<a className="underline" href={`/admin/blog/${kind}?edit=${row.id}`}>{row.name}</a><span className="text-sm text-ink-muted">/{row.path}</span>
|
|
49
|
+
<form action={kind === "authors" ? deleteAuthorAction : deleteTermAction}><input type="hidden" name="id" value={row.id} /><input type="hidden" name="taxonomy" value={taxonomy} /><Button type="submit" variant="danger">{t("blog.delete")}</Button></form>
|
|
50
|
+
</li>)}</ul>
|
|
51
|
+
{!current && terms.length + authors.length === 0 ? <p>{t("blog.directoryEmpty")}</p> : null}
|
|
52
|
+
</div>;
|
|
53
|
+
}
|
|
@@ -1,21 +1,201 @@
|
|
|
1
1
|
// Copyright (C) 2026 Tony Aly
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
"use server";
|
|
4
|
+
// Thin callers for the blog screens (C2.26–C2.28). Every rule lives in the
|
|
5
|
+
// cms services, so the admin, the HTTP API and MCP do the same thing.
|
|
4
6
|
import { redirect } from "next/navigation";
|
|
5
|
-
import {
|
|
7
|
+
import { revalidatePath } from "next/cache";
|
|
8
|
+
import { ensureDefaults } from "@/modules/cms/service";
|
|
9
|
+
import {
|
|
10
|
+
deleteAuthor,
|
|
11
|
+
createPost,
|
|
12
|
+
deleteTerm,
|
|
13
|
+
saveAuthor,
|
|
14
|
+
saveTerm,
|
|
15
|
+
setPostMeta,
|
|
16
|
+
updateBlogSettings,
|
|
17
|
+
} from "@/modules/cms/blog-service";
|
|
18
|
+
import { ServiceError } from "@/core/service";
|
|
19
|
+
import { env } from "@/core/env";
|
|
6
20
|
import { requireStaffActor } from "../guard";
|
|
7
21
|
import { currentBusiness } from "@/core/settings/read";
|
|
22
|
+
import { ownerFacing } from "../../action-helpers";
|
|
23
|
+
import { moderateReaderComment } from "@/modules/cms/blog-comments";
|
|
24
|
+
|
|
25
|
+
function text(form: FormData, key: string): string {
|
|
26
|
+
const value = form.get(key);
|
|
27
|
+
return typeof value === "string" ? value.trim() : "";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function optional(form: FormData, key: string): string | undefined {
|
|
31
|
+
return text(form, key) || undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function refused(error: unknown, back: string): never {
|
|
35
|
+
if (error instanceof Error && error.message === "NEXT_REDIRECT") throw error;
|
|
36
|
+
if (error instanceof Error && "digest" in error) throw error;
|
|
37
|
+
const message = error instanceof ServiceError ? ownerFacing(error.message) : "";
|
|
38
|
+
redirect(`${back}${back.includes("?") ? "&" : "?"}error=${encodeURIComponent(message || "1")}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
8
41
|
export async function createBlogPostAction(form: FormData) {
|
|
9
42
|
const actor = await requireStaffActor("cms", "manage");
|
|
10
43
|
const locale = (await currentBusiness())?.defaultLocale ?? "en";
|
|
11
|
-
const title = (
|
|
12
|
-
const slug = (
|
|
44
|
+
const title = text(form, "title");
|
|
45
|
+
const slug = text(form, "slug").toLowerCase();
|
|
13
46
|
if (!title || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)) redirect("/admin/blog?error=1");
|
|
14
47
|
let id: string;
|
|
15
48
|
try {
|
|
16
|
-
|
|
17
|
-
|
|
49
|
+
// Playground startup already seeds chrome; visitors cannot run bootstrap.
|
|
50
|
+
if (env().FREEHOLDER_PLAYGROUND !== "1") await ensureDefaults.call({ locale }, actor);
|
|
51
|
+
const page = await createPost.call(
|
|
52
|
+
{
|
|
53
|
+
title,
|
|
54
|
+
slug,
|
|
55
|
+
locale,
|
|
56
|
+
},
|
|
57
|
+
actor,
|
|
58
|
+
);
|
|
18
59
|
id = page.id;
|
|
19
|
-
} catch
|
|
60
|
+
} catch (error) {
|
|
61
|
+
refused(error, "/admin/blog");
|
|
62
|
+
}
|
|
20
63
|
redirect(`/admin/pages/${id}`);
|
|
21
64
|
}
|
|
65
|
+
|
|
66
|
+
export async function saveBlogSettingsAction(form: FormData) {
|
|
67
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
68
|
+
try {
|
|
69
|
+
await updateBlogSettings.call(
|
|
70
|
+
{
|
|
71
|
+
categoryBase: optional(form, "categoryBase"),
|
|
72
|
+
tagBase: optional(form, "tagBase"),
|
|
73
|
+
authorBase: optional(form, "authorBase"),
|
|
74
|
+
postsPerPage: Number(text(form, "postsPerPage")) || undefined,
|
|
75
|
+
commentsEnabled: form.get("commentsEnabled") === "on",
|
|
76
|
+
},
|
|
77
|
+
actor,
|
|
78
|
+
);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
refused(error, "/admin/blog");
|
|
81
|
+
}
|
|
82
|
+
revalidatePath("/admin/blog");
|
|
83
|
+
redirect("/admin/blog?saved=1");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export async function moderateReaderCommentAction(form: FormData) {
|
|
87
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
88
|
+
const status = text(form, "status");
|
|
89
|
+
if (!["pending", "approved", "spam", "trash"].includes(status)) redirect("/admin/blog/comments?error=1");
|
|
90
|
+
try {
|
|
91
|
+
await moderateReaderComment.call({ id: text(form, "id"), status: status as "pending" | "approved" | "spam" | "trash" }, actor);
|
|
92
|
+
} catch (error) { refused(error, "/admin/blog/comments"); }
|
|
93
|
+
revalidatePath("/", "layout");
|
|
94
|
+
redirect("/admin/blog/comments?saved=1");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export async function saveTermAction(form: FormData) {
|
|
98
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
99
|
+
const taxonomy = text(form, "taxonomy") === "tag" ? "tag" : "category";
|
|
100
|
+
const back = taxonomy === "tag" ? "/admin/blog/tags" : "/admin/blog/categories";
|
|
101
|
+
try {
|
|
102
|
+
await saveTerm.call(
|
|
103
|
+
{
|
|
104
|
+
id: optional(form, "id"),
|
|
105
|
+
taxonomy,
|
|
106
|
+
name: text(form, "name"),
|
|
107
|
+
slug: optional(form, "slug"),
|
|
108
|
+
description: text(form, "description") || null,
|
|
109
|
+
...(taxonomy === "category" ? { parentId: text(form, "parentId") || null } : {}),
|
|
110
|
+
seo: {
|
|
111
|
+
title: optional(form, "seoTitle"),
|
|
112
|
+
description: optional(form, "seoDescription"),
|
|
113
|
+
noindex: form.get("noindex") === "on",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
actor,
|
|
117
|
+
);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
refused(error, back);
|
|
120
|
+
}
|
|
121
|
+
revalidatePath(back);
|
|
122
|
+
redirect(`${back}?saved=1`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export async function deleteTermAction(form: FormData) {
|
|
126
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
127
|
+
const back = text(form, "taxonomy") === "tag" ? "/admin/blog/tags" : "/admin/blog/categories";
|
|
128
|
+
try {
|
|
129
|
+
await deleteTerm.call({ id: text(form, "id") }, actor);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
refused(error, back);
|
|
132
|
+
}
|
|
133
|
+
revalidatePath(back);
|
|
134
|
+
redirect(back);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export async function saveAuthorAction(form: FormData) {
|
|
138
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
139
|
+
try {
|
|
140
|
+
await saveAuthor.call(
|
|
141
|
+
{
|
|
142
|
+
id: optional(form, "id"),
|
|
143
|
+
name: text(form, "name"),
|
|
144
|
+
slug: optional(form, "slug"),
|
|
145
|
+
bio: text(form, "bio") || null,
|
|
146
|
+
email: text(form, "email") || null,
|
|
147
|
+
userId: text(form, "userId") || null,
|
|
148
|
+
seo: {
|
|
149
|
+
title: optional(form, "seoTitle"),
|
|
150
|
+
description: optional(form, "seoDescription"),
|
|
151
|
+
noindex: form.get("noindex") === "on",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
actor,
|
|
155
|
+
);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
refused(error, "/admin/blog/authors");
|
|
158
|
+
}
|
|
159
|
+
revalidatePath("/admin/blog/authors");
|
|
160
|
+
redirect("/admin/blog/authors?saved=1");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export async function deleteAuthorAction(form: FormData) {
|
|
164
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
165
|
+
try {
|
|
166
|
+
await deleteAuthor.call({ id: text(form, "id") }, actor);
|
|
167
|
+
} catch (error) {
|
|
168
|
+
refused(error, "/admin/blog/authors");
|
|
169
|
+
}
|
|
170
|
+
revalidatePath("/admin/blog/authors");
|
|
171
|
+
redirect("/admin/blog/authors");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export async function savePostSettingsAction(form: FormData) {
|
|
175
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
176
|
+
const pageId = text(form, "pageId");
|
|
177
|
+
const back = `/admin/pages/${pageId}`;
|
|
178
|
+
try {
|
|
179
|
+
const isPost = form.get("isPost") === "on";
|
|
180
|
+
await setPostMeta.call(
|
|
181
|
+
isPost
|
|
182
|
+
? {
|
|
183
|
+
pageId,
|
|
184
|
+
isPost,
|
|
185
|
+
authorId: text(form, "authorId") || null,
|
|
186
|
+
categoryIds: form.getAll("categoryIds").filter((value): value is string => typeof value === "string" && value !== ""),
|
|
187
|
+
tagNames: text(form, "tags")
|
|
188
|
+
.split(",")
|
|
189
|
+
.map((tag) => tag.trim())
|
|
190
|
+
.filter(Boolean),
|
|
191
|
+
...(form.has("commentsSetting") ? { commentsEnabled: form.get("commentsEnabled") === "on" } : {}),
|
|
192
|
+
}
|
|
193
|
+
: { pageId, isPost: false },
|
|
194
|
+
actor,
|
|
195
|
+
);
|
|
196
|
+
} catch (error) {
|
|
197
|
+
refused(error, back);
|
|
198
|
+
}
|
|
199
|
+
revalidatePath(back);
|
|
200
|
+
redirect(`${back}?saved=post`);
|
|
201
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (C) 2026 Tony Aly
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { listReaderCommentsForOwner } from "@/modules/cms/blog-comments";
|
|
4
|
+
import { Button, Select } from "@/ui/primitives";
|
|
5
|
+
import { getT } from "../../../../i18n";
|
|
6
|
+
import { requireStaffActor } from "../../guard";
|
|
7
|
+
import { moderateReaderCommentAction } from "../actions";
|
|
8
|
+
export const dynamic = "force-dynamic";
|
|
9
|
+
const states = ["pending", "approved", "spam", "trash"] as const;
|
|
10
|
+
export default async function CommentQueue({ searchParams }: { searchParams: Promise<{ status?: string; error?: string; saved?: string; page?: string }> }) {
|
|
11
|
+
const actor = await requireStaffActor("cms", "manage");
|
|
12
|
+
const query = await searchParams;
|
|
13
|
+
const status = states.find(value => value === query.status);
|
|
14
|
+
const page = Math.max(1, Math.min(10000, Math.floor(Number(query.page)) || 1));
|
|
15
|
+
const pageHref = (number: number) => `/admin/blog/comments?page=${number}${status ? `&status=${status}` : ""}`;
|
|
16
|
+
const [t, comments] = await Promise.all([getT(), listReaderCommentsForOwner.call({ status, page }, actor)]);
|
|
17
|
+
return <div className="grid max-w-3xl gap-6"><h1 className="text-2xl font-semibold">{t("blog.comments")}</h1>
|
|
18
|
+
<a className="underline" href="/admin/blog">{t("blog.title")}</a>
|
|
19
|
+
<nav className="flex flex-wrap gap-4" aria-label={t("blog.commentStatus")}><a className="underline" href="/admin/blog/comments">{t("blog.commentAll")}</a>{states.map(value => <a key={value} className="underline" href={`/admin/blog/comments?status=${value}`}>{t(`blog.commentState.${value}`)}</a>)}</nav>
|
|
20
|
+
{query.error ? <p role="alert">{t("common.somethingWentWrong")}</p> : null}{query.saved ? <p role="status">{t("blog.saved")}</p> : null}
|
|
21
|
+
{!comments.length ? <p>{t("blog.commentEmpty")}</p> : null}
|
|
22
|
+
<ul className="grid list-none gap-5 p-0">{comments.map(comment => <li key={comment.id} className="grid gap-3 rounded-lg border border-rule bg-surface p-5"><div className="flex flex-wrap justify-between gap-3"><strong>{comment.authorName}</strong><time dateTime={comment.createdAt.toISOString()}>{comment.createdAt.toLocaleString()}</time></div><p className="whitespace-pre-wrap break-words">{comment.body}</p><a className="underline" href={`/admin/pages/${comment.pageId}`}>{t("blog.commentPost")}</a><form action={moderateReaderCommentAction} className="flex flex-wrap gap-3"><input type="hidden" name="id" value={comment.id} /><Select name="status" defaultValue={comment.status} aria-label={t("blog.commentStatus")}>{states.map(value => <option key={value} value={value}>{t(`blog.commentState.${value}`)}</option>)}</Select><Button type="submit">{t("blog.save")}</Button></form></li>)}</ul>
|
|
23
|
+
{page > 1 || comments.length === 100 ? <nav className="flex justify-between gap-4" aria-label={t("blog.comments")}>{page > 1 ? <a className="underline" href={pageHref(page - 1)}>{t("blog.previous")}</a> : <span />}{comments.length === 100 && page < 10000 ? <a className="underline" href={pageHref(page + 1)}>{t("blog.next")}</a> : null}</nav> : null}
|
|
24
|
+
</div>;
|
|
25
|
+
}
|
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
// Copyright (C) 2026 Tony Aly
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
3
|
+
import { getBlogSettings, listPostPages } from "@/modules/cms/blog-service";
|
|
4
4
|
import { Button, Field, Input } from "@/ui/primitives";
|
|
5
5
|
import { getT } from "../../../i18n";
|
|
6
6
|
import { requireStaffActor } from "../guard";
|
|
7
|
-
import { createBlogPostAction } from "./actions";
|
|
7
|
+
import { createBlogPostAction, saveBlogSettingsAction } from "./actions";
|
|
8
8
|
export const dynamic = "force-dynamic";
|
|
9
|
-
export default async function BlogAdmin({ searchParams }: { searchParams: Promise<{ error?: string }> }) {
|
|
9
|
+
export default async function BlogAdmin({ searchParams }: { searchParams: Promise<{ error?: string; saved?: string }> }) {
|
|
10
10
|
const actor = await requireStaffActor("cms", "manage");
|
|
11
|
-
const [t, rows, query] = await Promise.all([getT(),
|
|
12
|
-
return <div className="grid max-w-3xl gap-6"
|
|
11
|
+
const [t, rows, settings, query] = await Promise.all([getT(), listPostPages.call({}, actor), getBlogSettings.call({}, actor), searchParams]);
|
|
12
|
+
return <div className="grid max-w-3xl gap-6">
|
|
13
|
+
<h1 className="text-2xl font-semibold">{t("blog.title")}</h1><p>{t("blog.adminIntro")}</p>
|
|
14
|
+
<nav className="flex flex-wrap gap-4" aria-label={t("blog.title")}><a className="underline" href="/blog">{t("blog.view")}</a>{["categories", "tags", "authors", "comments"].map(kind => <a key={kind} className="underline" href={`/admin/blog/${kind}`}>{t(`blog.${kind}`)}</a>)}</nav>
|
|
15
|
+
{query.error ? <p role="alert">{t("common.somethingWentWrong")}</p> : null}
|
|
16
|
+
{query.saved ? <p role="status">{t("blog.saved")}</p> : null}
|
|
17
|
+
<form action={createBlogPostAction} className="grid gap-4 rounded-lg border border-rule bg-surface p-6">
|
|
18
|
+
<Field label={t("cms.field.pageTitle")} htmlFor="title"><Input id="title" name="title" required maxLength={200} /></Field>
|
|
19
|
+
<Field label={t("cms.field.slug")} htmlFor="slug" hint={t("blog.slugHint")}><Input id="slug" name="slug" required pattern="[a-z0-9]+(-[a-z0-9]+)*" maxLength={160} /></Field>
|
|
20
|
+
<Button type="submit">{t("blog.create")}</Button>
|
|
21
|
+
</form>
|
|
22
|
+
<ul className="grid list-none gap-3 p-0">{rows.map(p => <li key={p.id} className="flex justify-between gap-4 border-b border-rule pb-3"><a className="underline" href={`/admin/pages/${p.id}`}>{p.title}</a><span>{t(`cms.status.${p.status}`)}</span></li>)}</ul>
|
|
23
|
+
<section><h2 className="text-lg font-semibold">{t("blog.settings")}</h2><form action={saveBlogSettingsAction} className="mt-4 grid gap-4">
|
|
24
|
+
{(["categoryBase", "tagBase", "authorBase"] as const).map(key => <Field key={key} label={t(`blog.${key}`)} htmlFor={key}><Input id={key} name={key} defaultValue={settings[key]} required /></Field>)}
|
|
25
|
+
<Field label={t("blog.postsPerPage")} htmlFor="postsPerPage"><Input id="postsPerPage" name="postsPerPage" type="number" min={1} max={50} defaultValue={settings.postsPerPage} required /></Field>
|
|
26
|
+
<label className="flex gap-2"><input type="checkbox" name="commentsEnabled" defaultChecked={settings.commentsEnabled} />{t("blog.commentsEnabled")}</label><Button type="submit">{t("blog.save")}</Button>
|
|
27
|
+
</form></section>
|
|
28
|
+
</div>;
|
|
13
29
|
}
|
|
@@ -33,6 +33,8 @@ export default async function ImportRunPage({
|
|
|
33
33
|
["categories", t("imports.count.categories")],
|
|
34
34
|
["tags", t("imports.count.tags")],
|
|
35
35
|
["authors", t("imports.count.authors")],
|
|
36
|
+
["commentsImported", t("imports.count.commentsImported")],
|
|
37
|
+
["commentsStaged", t("imports.count.commentsStaged")],
|
|
36
38
|
["commentsSkipped", t("imports.count.commentsSkipped")],
|
|
37
39
|
["skippedPages", t("imports.count.skippedPages")],
|
|
38
40
|
];
|
|
@@ -41,6 +41,7 @@ import { PagePresence } from "./PagePresence";
|
|
|
41
41
|
import { PageComments } from "./PageComments";
|
|
42
42
|
import { currentBusiness } from "@/core/settings/read";
|
|
43
43
|
import { detachLayoutAction, fileHelpArticleAction, rejoinLayoutAction } from "../../../cms-actions";
|
|
44
|
+
import { BlogPostSettings } from "../../blog/PostSettings";
|
|
44
45
|
|
|
45
46
|
export const dynamic = "force-dynamic";
|
|
46
47
|
|
|
@@ -155,6 +156,8 @@ export default async function EditPagePage({
|
|
|
155
156
|
</div>
|
|
156
157
|
</div>
|
|
157
158
|
|
|
159
|
+
<BlogPostSettings pageId={page.id} actor={actor} />
|
|
160
|
+
|
|
158
161
|
<PageEditor
|
|
159
162
|
id={page.id}
|
|
160
163
|
initialVersion={page.version}
|