• AI reference · Area online

deploy_site

Preview a site. Use this to put a site online as a private preview, on the task you hold (undo: true goes back to the last live version). Agency-grade, from their brand (brand.json) and the skill build-a-landing-page, never a blank page; brand changes: a file_change to brand.json. Show the owner its private preview link, never files in chat. Going live is a site_publish proposal. The checker's rules (code, the members area, forms and the person check, sizes) are in the files field; a refusal names what to fix. Not for: a payment link (payment_link) or a class (records_put).

Where it is

In the online area (your website: pages, forms, sign-ups, the member area, selling, classes and calls, going live; its look; payment links; course progress; giving or taking away member access): open it with tools_for { area: "online" }, then call it with use_tool { name: "deploy_site", args }.

Does it need a yes?

Runs at once, no yes card: it changes only the office's own working state, and nothing reaches anyone. Here: a preview only; putting it online is a site_publish yes.

Inputs

InputTypeNeededAbout
sitestringyesThe site's short name, e.g. home, landing or an app's name. · format `^[a-z0-9][a-z0-9-]{0,39}$`
filesarray of objectnoThe site's files (all the first time, with index.html; with base only the changed ones). Kinds: html, css, js, mjs, json, svg, txt, xml, webmanifest, map; with encoding base64: png, jpg, gif, webp, avif, ico, woff, woff2, pdf. Any code works on public pages: paste tracking or widget code into the head, the footer or a code block (page.json site_code on the front page, code on a page; skill tracking). While this office's public pages are still locked, code inside a page (a script without src, onclick=) is refused: put it in a .js file and name an outside script's host in co1-app.json allowedHosts.script. The members area (members/) runs only this site's own files: no inline code, no outside scripts. A form posts to action="/api/v1/forms/<form>" on this site, never a full address. Declare each form in co1-app.json at the root: {"v":1,"id":"<site>","kind":"static","permissions":["forms.submit"],"forms":{"<form>":{"thanks":"/thanks/","fields":{"name":{"type":"text"},"email":{"type":"email"}}}}}. Every input name is a declared field (lowercase, digits, _); each form has an email field; thanks is your page after sending (else a plain one). Each form holds the person check, <div class="cf-turnstile" data-sitekey="<turnstile_site_key from read: true>"></div>, with <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script> on the page; or co1-app.json says "turnstile": false (not for member sign-in). In members/, code calls only /api/v1/ or a host in allowedHosts.connect. No password, card, bank or one-time-code fields. A newsletter field is a visible checkbox, never ticked for them. Send people elsewhere with a plain link: never code, a meta refresh or an address built from what a visitor typed. Library pictures: media [{ path, asset_id }]; else pictures, fonts, pdf: base64. Sizes come with the plan (read: true); about 3 MB a call, the rest with base. read and undo go alone; remove goes with base; base alone remakes the collections' pages (records_put; a file's path says how). Selling needs checkout.create, members/index.html and products with a price (same skill). · 1 to 400 items
files[].pathstringyesIts path in the site, e.g. index.html or assets/style.css; a collection's pages are _collections/<name>/entry.html and list.html (a blog's category.html and tag.html optional) with {{field}}, {{field|markdown}}, {{#entries}} and {{/entries}}, their addresses only https, mailto or a path starting /, never in script, style or on* (skill build-a-landing-page, part Collections and search). · format `^(?!.*\.\.)(?!\/)[A-Za-z0-9._/-]{1,200}$`
files[].bodystringyesThe file's text (or base64 with encoding base64). · up to 2,900,000 characters
files[].encoding"utf-8" | "base64"no
undobooleannotrue: go back to the version that was live before, as a new version with its files (no files); then propose site_publish as usual.
basestringno"live" or a version deploy_site answered: files are then only the changed ones. · format `^(live|[0-9a-f]{16,64})$`
removearray of stringnoWith base: files or page folders (about/) that go. · up to 50 items
readbooleannotrue: the site's address, versions, pages and files (with path: one file's text, information only). base picks the version.
rebrandbooleannotrue: the whole site again in the company's current brand.json (its pages rebuilt, brand.css), as a new preview.
mediaarray of objectnoPictures from the company's media library: each one's web-sized copy (.webp once the library made it) goes into this version at its path, counted in the site's size. With files or base, like any changed file. · 1 to 300 items
media[].pathstringyesWhere the picture goes in the site, e.g. media/studio.webp; pages show it as /media/studio.webp. · format `^(?!.*\.\.)(?!\/)[A-Za-z0-9._/-]{1,200}$`
media[].asset_idstringyesThe picture's id in the company's media library. · format `^[A-Za-z0-9_-]{1,100}$`
pathstringnoWith read: one file, e.g. about/page.json. · format `^(?!.*\.\.)(?!\/)[A-Za-z0-9._/-]{1,200}$`
pageobjectnoNo code runner: one page's page.json, shaped like the skill build-a-landing-page's sample page.json (it needs brand, its lists hold objects, not plain strings, and lang is English when left out), built here onto the live site (or base).
messagestringnoWith files: a short note on what changed in this version. · 1 to 500 characters
taskintegeryesThe task you hold that this is for. · 1 or more
run_idstringyesThe run_id from start. Pass it on every call: it keeps your task held. · 1 to 100 characters

Example

{
  "name": "deploy_site",
  "arguments": {
    "site": "home",
    "task": 1,
    "run_id": "the run_id from start"
  }
}

When it is refused

  • invalid: The input isn't right. The sentence names the field and the fix; nothing was done. Fix it and call again.
  • not_found: No such thing in this company (a task, file, person, record). Check the number or name, or list first.
  • not_allowed: Not without another step: the owner's yes, your own task held with pick_up, or a setting the owner turns on. The sentence says which.
  • taken: Someone else holds it (another AI on that task). Pick another task.
  • stale: It changed since you read it. Read it again and use the new version.
  • failed: On our side or a service's, never your input. Try again in a minute; if it keeps failing, call report_problem.