# @cloudhal/cloudflare ## 0.10.1 ### Patch Changes - @cloudhal/agent-runtime@0.10.1 - @cloudhal/analytics@0.10.1 - @cloudhal/api@0.10.1 - @cloudhal/comments@0.10.1 - @cloudhal/core-ts@0.10.1 - @cloudhal/mcp-server@0.10.1 - @cloudhal/schedules@0.10.1 - @cloudhal/storage@0.10.1 ## 0.10.0 ### Patch Changes - 74d7098: RFC-0045 rollout step 7b: **reference and repeater fields are now enabled.** Sites can define `reference` fields (entries of one to five collections of the same site, one or several, with optional conditions) and `repeater` fields (ordered lists of items with up to ten flat sub-fields) wherever the renderer serving them reads the two types. See [docs/guides/fields.md](https://github.com/cloudhal-dev/cloudhal/blob/main/docs/guides/fields.md). - **Where.** On Cloudflare, once the site Worker serving the site answers `GET /__cloudhal/features` with `fields: 2` (0.9.0 and later): the admin Worker asks the Worker each site is routed to (`SITE`, or an attached `SITE_n`), as it asks for time gates, and remembers a yes for that Worker only. Time gates are now confirmed per site Worker too, so a site on an older attached Worker no longer inherits the installation Worker's answer. Deploy the site Worker first; until it reports `fields: 2`, the types stay refused with `fields_unsupported` on every path. On Node (`cloudhal dev`, `studio`, self-host, Docker) and in the playground, always, since the renderer runs in the same process (`openLocalStore` passes `FIELDS_SUPPORTED`). - **Every write path follows the capability:** Studio, MCP, the API, field operations and their dry runs, and every bundle: `cloudhal push` (the admin route passes the store's capability), `pull`, `cloudhal import` (dry runs included), `--replace` and `--revert`. A bundle that defines either type is still refused whole where the capability does not hold, and a site's new snapshot cannot point at another site's held site body to bring the types in. - **MCP and Studio.** `update_collection` and `change_field_type` list both types, and `/api/instance` answers `features.referenceFields: true`, on servers that have the capability. The store still decides per site. - **A one-time `entry_refs` check per site** (`rebuildEntryRefs`, new core-ts export): the admin Worker's new `refs.rebuild` system job (every five minutes, offset from `lists.backfill`, until every site is done; then two reads a run), and `openLocalStore` at start-up. Rows are written per entry, anchored on the hash each entry was read with, so a concurrent edit keeps its own rows; each chunk is anchored on the site node's hash, so no statement grows with the site's settings; it leaves a site alone while a text ↔ reference type change runs there; progress is in the new `entry_refs_state` table (storage migration `0034_entry_refs_state`), so a run stopped anywhere resumes. It is a safety net and should find nothing to change. - Updated dependencies [74d7098] - @cloudhal/core-ts@0.10.0 - @cloudhal/storage@0.10.0 - @cloudhal/api@0.10.0 - @cloudhal/mcp-server@0.10.0 - @cloudhal/agent-runtime@0.10.0 - @cloudhal/analytics@0.10.0 - @cloudhal/comments@0.10.0 - @cloudhal/schedules@0.10.0 ## 0.9.0 ### Patch Changes - 9aa67d3: RFC-0045 rollout step 3b: publishes purge the pages that show references. Nothing changes for sites without reference definitions. Their publish purge plans are the same, with no bundle read. Their release runs send the plan stored at pin time, as before, with no re-plan; the only addition is one read of the published site node, to tell them apart. - **The referrer closure** (`references/purge.ts`, called by `planCachePurge`). - The seeds are the groups of every changed, added or removed entry, and of every entry whose shown asset changed. - It purges the referrers of those groups, two hops deep, with every language version of each referrer. - It also purges every member of each group a changed entry names, before or after ("used by"). - Values are resolved, so a translation that only inherits counts. - It reads only the `from` and `to` snapshots' bodies, never the working copy or `entry_refs`. - **Reads and budgets.** A publish that changes no entry and no shown asset reads nothing. Otherwise the closure keeps one hash-keyed cache: - one bundle (`to`'s, else `from`'s), streamed and cut down as each shard is parsed; - then the missing hashes, read by the closure itself, six at a time, and cut down the same way. A passed budget purges everything: - bytes (`maxBodyBytes`, 32 MB); - nodes (`maxNodes`, 50,000); - reads (`maxReads`, shard reads included); - tags (`maxTags`). So does any field-operation marker on either snapshot's site node, for sites that hold references or convert from them. - **`readSnapshotBundle`** (`SnapshotReader.readSnapshotBundle`, `SiteGraphStore.readSnapshotBundle`, `readSnapshotBundle` in bundles) takes optional `maxBytes`, `maxNodes`, `keep`, `only` (bodies node by node) and `spent` (a shared byte total). A passed budget throws `BundleBudgetError` before the shard is parsed. No new cache tags. - **Release runs on sites with references re-plan their purge at run time** (`references/release-purge.ts`), from the pointer they moved to the snapshot they made, instead of sending the plan stored at pin time. - The test is the published site node, which `publishRelease` now returns (`publishedSite`). That costs one blob read per run with a purger, except on a first publish; the read is counted, never refused. If it fails, the working row decides. - The re-plan runs over the tick's counting driver. - The release graph's blob calls (`refreshSearch`, `labelOf`, the re-plan) are charged to one allowance per invocation, shared by the cron's ticks (`ScheduledTickOptions.releaseBlobs`): 350 on Workers Free, 3,000 on Paid. "Publish now" sizes it from the deployment's tick budget (`ReleaseService` and `SchedulesDeps.tickBudget`). - Past the allowance, or if the re-plan fails, the run purges everything. A re-plan with more distinct terms than reads left purges everything before reading anything. - The pin-time plan skips the closure (`CachePurgeOptions.references: false`): for these sites it is the expected outcome only. - `RELEASE_EXECUTOR_COST` is 26 (it counts `refreshSearch` and `recordPurge` now). - **`@cloudhal/cloudflare`:** the cron handler passes one `releaseBlobs` allowance to both ticks of its invocation (`cronTick`); the alarm and the request backstop run one tick each, with the default allowance. - Updated dependencies [41d783a] - Updated dependencies [9aa67d3] - Updated dependencies [bb43a16] - Updated dependencies [dda55ee] - Updated dependencies [3678855] - Updated dependencies [b7ac2e9] - Updated dependencies [4a5633d] - @cloudhal/core-ts@0.9.0 - @cloudhal/mcp-server@0.9.0 - @cloudhal/api@0.9.0 - @cloudhal/agent-runtime@0.9.0 - @cloudhal/analytics@0.9.0 - @cloudhal/comments@0.9.0 - @cloudhal/schedules@0.9.0 - @cloudhal/storage@0.9.0 ## 0.8.0 ### Patch Changes - dc519c0: The consumers of reference fields (RFC-0045 §2, rollout step 2b, #114). Both new field types stay refused on every write path in production, so none of this is reachable before rollout step 7. The shared suites run it through `SiteGraphStoreOptions.fieldTypes`. - **Assets inside repeater items.** `fieldAssetRefs` walks items and records `fields..` with each use's item path. `fieldAssetIssues` checks sub-field types (a PDF in an image sub-field is refused) and reports at every item that uses the file. Skips match issue paths by prefix, in the store and in the MCP precheck alike, so top-level behaviour is unchanged. - **Field-operation rewrites** write their entries' `entry_refs` rows. A rewrite that changes a reference value is guarded on its target, and every rewrite in a site with reference fields is guarded on the collection's definitions. - **Releases** no longer treat reference values as dependencies, so a referenced entry is neither locked nor required live. - **Language editions** (`forEdition`) keep only what the edition's own write accepts. A reference needs a member of its group in an allowed collection that meets the field's `where`. A single-target field keeps one id, and a multiple field keeps at most `maxItems`. An entry holds at most 100 references, and a repeater at most `maxItems` items. Values are read through a running rename's old key. Everything not carried, including repeater items left empty, is reported with its reason through `onDropped`. A re-save keeps the values the edition entry already holds, as its own write would. - **CLI.** `cloudhal import --dry-run` warns about references that will show nothing, and about originals relinked into another group. - **Cloudflare.** `siteFieldTypeSupport` reads the site Worker's `fields` feature. `FIELDS_FEATURE_VERSION` and `FIELDS_SUPPORTED` are exported from `@cloudhal/core-ts/fields`. Nothing passes them to a store before step 7. - **API.** `GET /sites/:siteId/entries/pick` is the entry picker. Its search folds case and diacritics on both sides with `foldName`, Turkish İ and ı included, and reads at most 1,000 entries per request. When that runs out before 20 matches, it answers `truncated: true` with a `cursor` to continue from. `GET /sites/:siteId/entries/:entryId/references` lists an entry's referrers, each with the language versions that show it. Both need `content:read`. - Updated dependencies [dc519c0] - Updated dependencies [b6cf70f] - Updated dependencies [d107895] - @cloudhal/core-ts@0.8.0 - @cloudhal/api@0.8.0 - @cloudhal/mcp-server@0.8.0 - @cloudhal/storage@0.8.0 - @cloudhal/comments@0.8.0 - @cloudhal/agent-runtime@0.8.0 - @cloudhal/analytics@0.8.0 - @cloudhal/schedules@0.8.0 ## 0.7.3 ### Patch Changes - Updated dependencies [5cb0a5d] - @cloudhal/core-ts@0.7.3 - @cloudhal/api@0.7.3 - @cloudhal/comments@0.7.3 - @cloudhal/mcp-server@0.7.3 - @cloudhal/agent-runtime@0.7.3 - @cloudhal/analytics@0.7.3 - @cloudhal/schedules@0.7.3 - @cloudhal/storage@0.7.3 ## 0.7.2 ### Patch Changes - Updated dependencies [060a9c8] - @cloudhal/api@0.7.2 - @cloudhal/core-ts@0.7.2 - @cloudhal/mcp-server@0.7.2 - @cloudhal/comments@0.7.2 - @cloudhal/agent-runtime@0.7.2 - @cloudhal/analytics@0.7.2 - @cloudhal/schedules@0.7.2 - @cloudhal/storage@0.7.2 ## 0.7.1 ### Patch Changes - 24fe76b: Security fixes from the CodeQL backlog on `main`. - **Prototype pollution.** A2UI `updateDataModel` paths (`@cloudhal/core-ts/interop`) that name `__proto__`, `constructor` or `prototype` at any depth are now refused with an `InteropError` instead of being skipped, step into arrays by index only, and write own properties only; an input whose component id is one of those keys gets the data key `-value`. Surface pointers the page writes through (an input's `value`/`checked`, a Scrolly's `step`, a Button action's `path`) may not name those keys (a `checkSurface` issue); read bindings still may. The Build eval's sample inputs never write through them, and `set_chrome` and `update_entry`'s `fields` merge patch refuse them as keys. `RESERVED_KEYS` and `isReservedKey` are new in `@cloudhal/core-ts/names`. - **Plain text from HTML.** `htmlText` (meta and feed descriptions, JSON-LD, table-of-contents labels) is plain text: `<script>` in markdown is the text `