Plugin pages
Plugin pages
Generated pages use BlokeBot page documents for standard controls. Embedded pages provide a contained browser experience.
Page types
- BlokeBot renders standard text sections.
- BlokeBot renders standard status sections.
- BlokeBot renders standard form sections.
- BlokeBot renders standard table sections.
- BlokeBot renders standard list sections.
- Generated pages
- A Lua renderer returns a versioned page document.
- Embedded pages
- BlokeBot serves declared browser assets in one contained frame. The browser bridge validates messages.
Generated page declarations
It returns document version 1 with an ordered list of sections.
- The renderer receives version.
- The renderer receives hostId.
- The renderer receives sessionId.
[[generatedPages]]
id = "queue-management"
featureId = "collection"
route = "queue-management"
title = "Queue management"
module = "pages"
renderEntryPoint = "render_queue"Page documents
- text contains static body content.
- status contains a short state with a supported tone.
- form uses one declared page action.
- table contains rows with declared columns.
- list contains short item collections.
render_queue = function(input)
return {
version = 1,
introduction = "Review one item.",
sections = {
{
kind = "status",
title = "Queue ready",
description = "The queue can accept reviews.",
tone = "neutral",
},
},
}
endForms and actions
plugin.toml declares each page action input.
- BlokeBot rejects unknown fields.
- BlokeBot rejects duplicate fields.
- BlokeBot rejects a missing required field.
- BlokeBot rejects a value with the wrong kind.
- The form must use the same field IDs.
- The form must use the same required flags.
- The form must use the same value kinds.
- text
- This type produces a string value.
- multiline
- This type produces a string value.
- choice
- This type produces one declared string value.
- number
- This type produces a finite number value.
- boolean
- This type produces a true or false value.
Embedded page declarations
Every served asset must belong to the page declaration. Each successful asset response uses the page content policy and nosniff headers.
[[embeddedPages]]
id = "queue-bridge"
featureId = "collection"
route = "queue-bridge"
title = "Queue bridge"
documentAsset = "queue-document"
assets = ["queue-document", "queue-script", "queue-styles"]
messageOrigins = []Browser bridge
The bridge checks the frame source and HTTPS origin.
A message ID can run once in its active session. A restart invalidates the in-memory page session.
- The bridge also checks message size.
- The bridge also checks selected host.
- The bridge also checks active plugin state.
- The bridge checks the session.
- The bridge checks the protocol.
- The bridge checks the schema.
- Send only a declared page action.
- Send only fields from that action schema.
- Use a new message ID for each action attempt.
- Treat a rejected or expired session as terminal.