SkybuDocs

Ferdigheter · Apper

Publish a document as a page

Put a report, an analysis or any other finished HTML on an address people can open, with no build, and keep every earlier version readable at its own address.

skill://apps/publish-a-pageAgenter leser den med resources/read eller skills_read. Den er skrevet på engelsk, for agentene.

A page is a static site whose files are published as they are: no build, no image, nothing that runs. Use it for what you have written yourself and want people to read: a report, a meeting summary, an analysis with charts, a prototype in one HTML file. It is live within seconds, and every time you publish it again you make a new version.

When the files need a build first (a Vite or Next.js project), deploy them instead (skill://apps/static-site).

In short

  1. Write the page: an index.html at the top, with its CSS, scripts and images beside it.
  2. Ask the user what data it holds (the data class), unless the page exists already.
  3. Call publish_page with projectId, a name and the files.
  4. Give the user url (the page, always the newest version) and, when it matters and is not null, versionUrl (this version only).

Publish

{
  "name": "publish_page",
  "arguments": {
    "projectId": "<project id>",
    "name": "kvartalsrapport",
    "dataClass": "internal",
    "files": [
      { "path": "index.html", "content": "<!doctype html><html lang=\"nb\">…</html>" },
      { "path": "style.css", "content": "body { font-family: system-ui; }" },
      { "path": "img/chart.png", "content": "<base64>", "encoding": "base64" }
    ]
  }
}
  • name is 3 to 31 lowercase letters, digits and hyphens, and starts the address: https://kvartalsrapport.<org>.skybu.app.
  • The data class and department are asked for as for any app (skill://apps/describe-the-app). A report about customers or employees is personal; ask rather than guess.
  • Links may be relative (img/chart.png) or start at the root (/style.css); both work at the page's address and at every version's address.
  • /notes serves notes/index.html (or a file named notes). Unknown paths get your 404.html, or a plain 404.
  • A name that belongs to an app running as a server is refused with app_is_server: choose another name.

The answer comes once the version is live (usually a few seconds), with status: "live". If the organisation requires approval for the page's data class, status is awaiting_approval: tell the user that an owner or admin must approve it, since agents cannot. If it is still deploying after 20 seconds, follow it with get_deployment.

Versions

Publishing again to the same name makes version 2, 3 and so on. The page's own address always shows the newest (or the one rolled back to). Where the organisation's wildcard certificate covers it, each version also has an address of its own that keeps showing exactly what was published, such as https://kvartalsrapport--v2.<org>.skybu.app. Link to that one when the user needs to point at a version that must not change, for example in minutes or a decision.

Where no wildcard certificate covers the organisation's addresses yet, versionUrl is null, versionAddresses is false and note says why. Then there is no address for an earlier version: never build one yourself from the pattern above. Tell the user the page's address shows the newest version, and that rollback_app can show an earlier one there.

{ "name": "list_page_versions", "arguments": { "appId": "<app id>" } }

Skybu keeps the 10 newest versions. Older ones, their addresses and their files are removed within the hour. To show an earlier version at the page's own address again, use rollback_app with its deploymentId.

A version with an address has its own hostname, so one version's scripts cannot read another version's cookies or storage, nor another page's or app's.

A page's files are copied off-site with Skybu's backups, since they cannot be built again from source.

Who can read it

A page has the same access as any app (skill://access/members-only-apps): public, or members only through the organisation's sign-in. The version addresses follow the page: when the page is members-only, so is every version.

Limits

LimitValue
Files through publish_page5 000, at most 8 MB in the request
Through skybu page publish200 MB compressed, 500 MB unpacked, 20 000 files

Links, devices and paths outside the folder are refused (static_invalid), and so is a folder without index.html at its top (static_no_index). A refused publish leaves no version behind, and the page keeps serving what it served.

From a terminal: skybu page publish ./report --project <name> --page kvartalsrapport, and skybu page versions <project>/kvartalsrapport.