Open App Definition (OAD) 0.2: Catalogs and Contracts#
Status: working draft. Read core.md first.
1. Catalogs#
A catalog is a versioned, publishable JSON document (*.oadcatalog.json) that holds contracts. A contract describes one reusable part: a control (a building block for visual and voice surfaces) or a capability (typed access to the outside world). Anyone can publish a catalog. The standard defines how parts are described, not which parts exist.
{
"oadCatalog": "0.2",
"id": "org.openappdefinition.core",
"version": "0.2.0",
"meta": { "name": "OAD Core", "description": "Baseline controls and capabilities.", "publisher": "Open App Definition", "license": "Apache-2.0" },
"types": {},
"contracts": {}
}
id and version follow the same rules as a definition's. meta has name and description (both required) and optional publisher, license and homepage. types is an optional object of shared type definitions, referenced from contracts by name and from definitions as alias:TypeName. contracts is required and is keyed by contract name.
Using other catalogs. A catalog MAY carry uses: { "catalogs": { alias: { "id", "version" } } }, which names other catalogs by id and semver range as a definition's uses.catalogs does (core.md section 4). Inside the catalog, a type reference MAY then be alias:TypeName, a requires entry's contract MAY be alias:contractName, and degradeTo MAY be alias:contractName. The graph of catalogs using catalogs MUST be acyclic (uses.catalogCycle). This is also how a contract outside the core catalog declares a file input that the host resolves and checks (core.md section 5): it types the field with the core catalog's FileRef.
{
"oadCatalog": "0.2",
"id": "com.example.expenses",
"version": "1.0.0",
"meta": { "name": "Expenses", "description": "Expense claims and policies." },
"uses": { "catalogs": { "core": { "id": "org.openappdefinition.core", "version": "^0.2.0" } } },
"types": { "ClaimLine": { "type": "object", "properties": { "amount": { "type": "number" }, "receipt": { "$ref": "core:FileRef" } }, "required": ["amount"] } },
"contracts": {}
}
The core catalog, org.openappdefinition.core in catalogs/core/, is described for readers in catalogs/core/README.md, generated from the catalog. It is the reference for the core controls with their props, events and slots, and for the core capabilities with their operations and scopes. Sections 8 and 9 below settle how those controls and capabilities behave where their declarations do not say.
Known values. A type in a catalog's types whose type is string MAY carry known: a list of 1 to 256 distinct strings, each 1 to 64 characters long, that are the values every implementation of the catalog should know. Each of them MUST be a value of the type itself, matching its pattern and within its minLength and maxLength (type.invalid). Such a type takes only type, known, pattern, minLength, maxLength, default, description and title, and known appears nowhere else: not inside another type, not on a field's own type, and not in a definition. A contract's field refers to the type by name, as Name, or as alias:Name from another catalog.
known never refuses a value. Any string that is a value of the rest of the type is valid wherever the type is expected, and an implementation MAY know more values than the list holds. A host gives each known value its meaning and treats a value it does not know as the type's description says. A checker warns where a definition gives a control prop of such a type a literal value outside the list (value.notKnown, validation.md section 6), and names the known values nearest to it by spelling; the definition stays valid, and a value given by an expression is not checked. A catalog MAY add values to known in a minor version, since no value becomes invalid; removing one is breaking.
{
"oadCatalog": "0.2",
"id": "com.example.weather",
"version": "1.0.0",
"meta": { "name": "Weather", "description": "Forecasts and the words for them." },
"types": {
"Sky": {
"description": "What the sky does. A host draws each known value with a picture of its own; it shows another value as its words.",
"type": "string",
"pattern": "^[a-z][a-zA-Z0-9]*$",
"known": ["clear", "cloudy", "rain", "snow", "storm"]
}
},
"contracts": {}
}
The core catalog's IconName is such a type, and its known list is the icon vocabulary: the names every host draws a symbol for. The core icon control's name, the core button's icon, a definition's meta.icon and the icon of a main section (core.md section 12.2) all take an IconName.
Names. Contract names, and the names of props, outputs, events, slots, slot scope variables, operations, config fields, token and variant names, follow the name rule of core.md section 3. Scope names are one or more such names joined by dots (transactions.read).
A catalog MAY be private: scoped to an organization and distributed through that organization's host configuration. Private and public catalogs share one format, so a private catalog is published later by changing where it is hosted, not what it contains.
2. Contract shape#
Controls and capabilities share one envelope, so vendors of either face the same rules.
{
"kind": "control",
"intent": "Show progress toward a numeric target.",
"since": "0.1.0",
"interface": {
"props": {
"value": { "type": "number", "description": "Current amount." },
"label": { "type": "string", "description": "Accessible name and visible caption." }
}
},
"surfaces": { "visual": { "support": "full" }, "voice": { "support": "degraded", "note": "Spoken as a percentage." } },
"accessibility": { "role": "progressbar", "labelProp": "label" },
"implementations": [],
"requires": [],
"distribution": { "license": "Apache-2.0" },
"conformance": []
}
| Field | Declares | Required |
|---|---|---|
kind |
control or capability. |
yes |
intent |
What the part is for, written so an AI can choose it and an agent can understand it. | yes |
since |
Catalog version that introduced the contract. | no |
deprecated |
{ "version", "replacement", "note" }: the catalog version that deprecated the contract, and optionally the contract in the same catalog that replaces it and a note. |
no |
interface |
The typed surface of the part (sections 3 and 4). | yes |
surfaces |
For controls: an entry for both visual and voice, each with support of full, degraded or none, a note (required when degraded), and optional degradeTo naming another control contract to use instead when support is degraded or none: a contract name in the same catalog, or alias:contractName for a contract in a catalog this catalog uses (section 1). The host passes the replacement only the props it declares. A control named in the degradeTo of a used control is itself used, transitively: its requires must be covered, and its pricing is shown, as for any control the definition names. |
controls |
accessibility |
For controls: role (a WAI-ARIA role name, required), optional alternateRoles (other roles the host may use when it picks a different presentation, such as a combobox for a listbox, or when prop values make another listed role the correct one, such as none for a decorative image), optional labelProp (the prop that supplies the accessible name; omitted when the name comes from content or the role takes none), and optional keyboard (array of { "key", "does" }). Key names are W3C UI Events key values, with Space for the space bar. keyboard describes the control in its role; a host that presents it in one of its alternateRoles follows the keyboard conventions of that role instead. Declared here so accessibility does not depend on each renderer. |
controls |
implementations |
Array of { "adapter", "module", "digest" } (all required) naming shipped implementations per adapter (web, skia, native-ios, mcp, http, and so on). digest is the digest of the module's bytes (core.md section 16). The host fetches a module and checks its digest when it installs the app; that is not egress (core.md section 6.3). Empty means descriptor-only: the host supplies its own. |
no |
requires |
Array of { "contract", "scopes" }: capabilities and scopes the part itself needs in order to work. contract is a contract name in the same catalog, or alias:contractName for a contract in a catalog this catalog uses (section 1). A definition using the part MUST request grants that cover these, so a part can never quietly widen an app's permissions. |
no |
distribution |
license (SPDX), optional pricing ({ "model": "free" \| "paid" \| "metered", "terms": uri }, with terms required unless the model is free), optional provenance ({ "source": uri, "build": uri }, with build optional). |
no |
conformance |
Array of { "suite", "version", "result": "pass" \| "partial", "report": uri } referencing conformance suite results. report is optional. |
no |
Compatibility within a catalog follows semver on the catalog version: within a major version, a contract MAY gain optional props, optional operation inputs, events and operations. Anything else is breaking.
3. Control interface#
"interface": {
"props": {
"value": { "type": "number", "description": "Current amount.", "bindable": false },
"max": { "type": "number", "description": "Target amount.", "default": 100 },
"label": { "type": "string", "description": "Accessible name and visible caption." }
},
"events": {
"press": { "description": "The user activated the control.", "payload": {} }
},
"outputs": {
"valid": { "type": "boolean", "description": "Whether every input inside currently meets its constraints." }
},
"slots": {
"item": { "description": "Template for one row.", "scope": { "item": "any", "index": "integer" }, "required": true }
},
"children": "none"
}
All of props, outputs, events and slots are optional.
propsis a field map (core.md section 3.3) with two extra per-field keys.bindable(defaultfalse) marks a prop that may appear in a node'sbindfor a two-way binding; a bound prop counts as supplied when it is required.remote(defaultfalse) marks a prop whose value can make the host fetch from the network, such as an image address; such props fall under the egress rule of core.md section 6.3. A value in such a prop, or a string inside it, MAY instead beasset:followed by the name of an asset the definition carries (core.md section 12.5), which the host loads from the definition itself: no fetch, and no grant.outputsis a field map of values the control produces and the app can only read, such as a form's validity. An output MUST NOT share a name with a prop. A node receives one by naming it inbind; the host writes the bound state. Onlytypeanddescriptionare meaningful on an output.eventsmaps an event name to a description and apayloadfield map.slotsmaps a slot name to a description, thescopevariables the slot's template can read (name to type reference), andrequired(defaultfalse). A slot withoutscopevariables is not a template repeated over data but one node, filled once: it reads what a child at the same place would (state, view state and the names around its node), and its handlers run as any handler does. The host fills such a slot for every control that declares one.- The
actionsconvention. A control that draws a header of its own (a title line above its content) declares what a person can do with that one control as an optional slot namedactions, withoutscopevariables, which the host draws at the end of the header. A control that gains a header later takes the same slot under the same name, so that authors and models find it in the same place. In the core cataloggroup,chart,table,list,canvasanddiagramhave it, andalerthas it for what to do about what it says (section 8.3). childrenisnone(the default),oneormany.- Common props every control accepts without declaring them:
variant(string, a design-system variant name),hidden(boolean) anddisabled(boolean). Section 8.2 says whathiddenanddisableddo.
4. Capability interface#
"interface": {
"config": {
"accountKind": { "type": "string", "description": "Which kind of account to read.", "required": false }
},
"operations": {
"listTransactions": {
"description": "List transactions, newest first.",
"input": { "since": { "type": "date", "required": false } },
"output": "Transaction[]",
"scope": "transactions.read",
"effect": "read"
}
},
"events": {
"transactionPosted": { "description": "A new transaction appeared.", "payload": { "transaction": { "type": "Transaction" } }, "scope": "transactions.read" }
},
"scopes": {
"transactions.read": { "description": "Read your transactions.", "sensitivity": "high" }
},
"traits": []
}
operations.<name>hasdescription, optionalinput(field map), optionaloutput(type reference),scope(the scope a grant must include to call it),effect, optionalinteractiveand optionalpaging.effectisread(no outside change, safe to retry),write(changes data the capability manages), orexternal(acts in the world: sends, pays, publishes).interactive: truemarks an operation that asks the person for something, such as picking a file or taking a photo; it cannot be a statesource. It is asked of the acting principal's person, on a surface of theirs that is active; with none, the call fails withcapability.unavailable. The host carries it out in its own interface, which says which app is asking and, when an agent started the work, that an agent did. Nothing reaches the app unless the person completes it, and a host never completes one for them.- A
writeorexternaloperation receives theoncekey of a call that gives one (core.md section 8.3). A provider that can recognize a repeated effect SHOULD perform the effect once per key and answer a repeat as it answered the first call. pagingdeclares that an operation returns its results in pages:{ "cursor": inputField, "next": outputField, "items": outputField }.cursornames an optional string input field that asks for the page after a given one,nextnames an output field that holds the cursor for the following page ornullwhen there is none, anditemsnames the output field that holds the page's list. The output MUST be a map type that declares both fields, the fielditemsnames MUST be a list, andcursorMUST name an optional input field of typestringorstring?; anything else iscontract.invalidPaging. A caller follows the pages whilenextis present and notnull. A state source can follow the pages (core.md section 7.1).events.<name>hasdescription,payload(field map) andscope. A grant condition written for the operations of a scope is applied to the payload of events under the same scope (core.md section 6), so an event SHOULD carry, under the same names, the fields those operations take as filters. An event that lacks them is withheld from every app whose grant is narrowed by them.scopes.<name>has a plain-languagedescription, shown to approvers,sensitivityoflow,mediumorhigh, and optionalconsent. Hosts SHOULD require stronger confirmation for higher sensitivity.consentisasked(the default) oruse.usemarks a scope as given by use: nothing happens under it unless a person does it themselves at that moment in the host's own interface, or has already handed the app the thing acted on. A request whose scopes are all given by use is not put to anyone; the person's own act each time is the consent (core.md section 6). A contract makes this promise for every operation under the scope, and three parts of it are checked (contract.invalidConsent): a capability with thebackgroundoregresstrait has no scope given by use, since what those traits permit follows from holding a grant and not from anything a person does; no event has a scope given by use; and an operation under one that is notinteractivehaseffect: "read". Such areadoperation reads only what a person gave the app through the host, such as the contents of a file they chose, and its description says so. A host honours the mark only from a catalog it trusts to make the promise, and treats the scope asaskedotherwise (core.md section 6).traitsis an array of strings that mark cross-cutting properties. The set is closed in 0.2:background(holding a grant on this capability permits unattended execution: timers, rules and source refreshes that run with no active surface),offline(operations work without a network and are queued or served locally by the provider),multiUser(the provider can supply identity and roles for more than one principal),egress(the capability's config names one network origin in a field calledorigin, and a grant on it permits the host to fetchremotecontent from that origin, per core.md section 6.3), andpersonal(the provider acts for one person: their device, their accounts, their files; a grant on it is answered by each person for themselves and covers only what is done on their behalf, per core.md section 6.4.2).- Only operations with
effect: "read"that are notinteractiveMAY be used as a statesource. - An operation has exactly one scope. Where a permission should depend on an input value, use one scope and let the definition's grant narrow it with
where.
5. Capability identity and equivalent providers#
A definition references a capability by contract (alias:name within a catalog id and version range). A provider is an implementation of that contract registered with a host under a provider id. Two providers that implement the same contract are equivalent as far as the definition is concerned.
When several providers match, the host chooses. The choice SHOULD follow, in order: an explicit user choice, host or organization policy, the definition's prefer list, and then a host default. Hosts MUST show which provider is bound, and SHOULD disclose when a paid provider was selected and why.
Paid parts. A part is paid when its distribution.pricing.model is paid or metered. An AI selecting parts on a person's behalf MUST NOT bind a paid capability provider, or use a control whose implementation is paid, without the approver seeing its pricing terms. A host shows those terms in the review the approver answers, beside the grant requests.
6. Design systems#
A design system is a JSON document (*.oaddesign.json):
{
"oadDesign": "0.2",
"id": "com.example.brand",
"version": "2.0.0",
"meta": { "name": "Example Brand", "description": "House style." },
"tokens": {
"color": {
"surface": "#ffffff", "text": "#1f1f1f", "textMuted": "#5f6368", "outline": "#747775",
"accent": "#0b57d0", "onAccent": "#ffffff",
"neutral": "#5f6368", "info": "#0b57d0", "success": "#146c2e", "warning": "#8a5300", "danger": "#b3261e",
"category1": "#0b57d0", "category2": "#b3261e", "category3": "#146c2e", "category4": "#8a5300",
"category5": "#6b3fa0", "category6": "#00687a", "category7": "#a8326b", "category8": "#5f6368"
},
"space": { "small": 4, "medium": 12, "large": 24 },
"type": { "body": { "family": "Inter", "size": 16, "weight": 400 }, "title": { "family": "Inter", "size": 24, "weight": 600 } },
"radius": { "medium": 8 },
"motion": { "quick": 120 },
"shadow": { "low": { "offset": 1, "blur": 3, "opacity": 0.14 } }
},
"modes": {
"dark": { "color": { "surface": "#121212", "text": "#f1f1f1" } }
},
"variants": {
"org.openappdefinition.core:button": { "primary": { "emphasis": "high" }, "quiet": { "emphasis": "low" } }
},
"catalogs": [ { "id": "com.example.brand-controls", "version": "^1.0.0" } ],
"agent": { "toolNaming": "camelCase", "errorStyle": "Say what failed and what to try next." }
}
metahasnameanddescription(both required) and optionalpublisherandlicense.tokensgroups named values. Token group names in 0.2:color,space,type,radius,motion,shadow. Renderers map token names onto their own styling.colorvalues are#rrggbbor#rrggbbaa.spaceandradiusvalues are non-negative numbers in density-independent units (one unit is a CSS pixel at standard density).typevalues are{ "family", "size", "weight" }with optionallineHeight.familyis a font family name or one of the generic namessystem-ui,serif,sans-serifandmonospace;sizeis in the same units asspace;weightis an integer from 1 to 1000;lineHeightis a multiple ofsize.motionvalues are durations in milliseconds, as numbers.shadowvalues are{ "offset", "blur", "opacity" }: how far down a shadow falls and how soft its edge is (the blur radius, as a CSS box shadow's), both in the same units asspace, and how opaque it is at its darkest, from 0 to 1. The names a canvas uses arelow,mediumandhigh(section 8.3); a design system that defines none of them has the default design system's values, and a mode MAY change them, as a dark mode does to keep a shadow as visible on a dark ground. A shadow is drawn in the design's ink, itstextcolor, at that opacity; in a mode whosetextis lighter than itssurface, a shadow in that color would read as a glow, so it is drawn in black.
modesoptionally maps a mode name to a partialtokensobject that overrides the base tokens while that mode is active.darkandhighContrastare the well-known mode names; others are allowed, and a host ignores modes it does not offer. A mode MUST NOT introduce a token the base does not define.- Definitions and catalogs refer to colors by token name, so portability needs a common minimum. Every design system MUST define these
colortokens:surface,text,textMuted,outline,accent,onAccent, the tonesneutral,info,success,warninganddanger, andcategory1tocategory8for data series. It MUST define thespacetokenssmall,mediumandlarge. A host that meets an unknown token name uses its nearest default and reports the node asdegraded. Text, tone and accent colors SHOULD reach a contrast ratio of at least 4.5:1 against the surface colors in every mode. Where a data-series color falls below 3:1 against its surface, hosts SHOULD keep labels or a tabular view of the same data available. variantsmaps a fully qualified control (catalogId:contractName) to named prop presets. A node selects one with the commonvariantprop. Presets MAY set only props the contract declares. The variants of the core catalog's default design system are listed incatalogs/core/README.md.catalogslists catalogs of custom controls that belong to the design system.agentholds conventions for agent surfaces generated under this design system.- A design system MAY restyle and preset any control. It MUST NOT alter a contract's interface, accessibility role or required grants.
7. Trust and distribution#
- Digest. As in core.md section 16, over the canonical JSON of the catalog, design system or definition. The digest of a definition leaves out the
dataof its assets and itsincluded, so a signature over it says nothing about the definition's carried copies unless the definition's reference pins their digest (a reference ofuses.designpins none). What stands for the same app as before is the app's digest together with the digests of the parts it resolved (core.md section 6.4.1). - Signature sidecar. A file beside the document, named after the document's file name with its final
.jsonreplaced by.sig.json(com.example.brand.oaddesign.jsonis signed bycom.example.brand.oaddesign.sig.json), holds{ "oadSignature": "0.2", "digest", "signatures": [ { "keyId", "algorithm", "value", "signedAt", "signer" } ] }.algorithmised25519in 0.2. The signed message is the UTF-8 bytes of thedigeststring, andvalueis the signature in unpadded base64url.signedAtis a UTCdatetimewritten withZ.signeris a reverse-DNS identity that SHOULD match or be a parent of the documentid. How hosts establish trust in keys (pinned keys, an organization root, a public registry) is host policy and outside 0.2. - Load policy. A host MUST verify digests wherever a definition pins one. A host SHOULD verify signatures of catalogs that ship executable
implementations, and MUST treat executable implementations from unsigned or untrusted catalogs as untrusted code. - Listing and certification. Passing the conformance suite is recorded in
conformance. Whether a registry requires it for listing is registry policy.
8. Control behaviour#
This section settles behaviour that a control's props and events do not show on their own. Sections 8.1 and 8.2 apply to every control; section 8.3 to controls of the core catalog, whose descriptions in the catalog say the same. A renderer is the part of a host that draws controls and takes the person's input.
8.1 Events and values#
- A host raises a control's events only for something the person did, or where this section says so.
- A renderer identifies what the person picked by position or key, and the host supplies the rest of the payload from the control's current props. In the
selectevent of a list, table or chart,itemis the element of theitemsprop at that position, exactly as the app passed it, so a handler can read any field of it; its type is the element type of the value given toitems. Payload fields that the host supplies are ignored if a renderer sends them. - A value from the person that the control's own props rule out is not written and raises no event: a number outside a slider's
minandmax, or an option that is not amongoptions. AsliderornumberInputrefuses a value that is notminplus a whole number of steps, as it refuses one outsideminandmax. AfileInputrefuses a file whose kind itsacceptprop excludes. - A text input writes its binding and raises
changeat least when the person pauses or leaves the field; a host MAY do so at every keystroke. - A choice option's
valueis a string, a number or a boolean. The bound value has the type of the option picked, and options are compared with==(expressions.md). - Controls that show numbers take a
NumberFormat(plain,currencyorpercent) and, forcurrency, a currency code, which defaults toenv.currency. With no code andenv.currencynull, a currency value is shown as a plain number.progresstakes aformat, and each chart series MAY take aformatof its own, which overrides the chart's. - A date input's
value,minandmaxtake the form itsmodesets:YYYY-MM-DDfordate, the canonical UTC datetimeYYYY-MM-DDTHH:MM:SSZfordatetime, andHH:MMon a 24-hour clock, with no date or zone, fortime. A state entry of typedateordatetimecan be bound to it in those modes. - A prop that names a design token, such as a chart series
color, a canvas shape'sfillandstroke, a canvasbackground, or a choice option'sswatch, takes a token name. An unknown name falls back to the host's nearest default, and the node is reported asdegraded(section 6).
8.2 Presence: when, hidden and disabled#
- A node whose
whenis not true does not exist: it is not drawn, raises no events, writes no outputs, loads nothing, and counts toward no form. What the host held for it, such as the text in an unbound input, is discarded. - A node with
hidden: truekeeps its place and whatever the host holds for it, but it is not drawn or announced, loads nothing remote, raises no events, and its inputs count toward no form. Its children and slots are hidden with it. - A node with
disabled: true, and every node inside it, is shown as unavailable and raises no events from the person, and its inputs count toward no form. A node inside cannot undo this withdisabled: false. - When a canvas stops raising events while a key it reported pressed is still down, because its
whenis no longer true, it is hidden or disabled, or a dialog makes it unavailable, the host itself raises that key's release at it once, as the node was when it last raised events, with any confirmation the handler asks for answered no and any navigation it makes ignored. - A node repeated with
eachcounts as one node per element wherever controls count nodes: each is a panel oftabsand an input of a form.
8.2.1 Direction and text#
- A host lays out an app in the direction of the language the app is shown in, and takes it from nothing else: never from the page or window around the app. An app shown in no language of its own is laid out as the page around it is.
- A host gives a session the person's languages, in order of preference as the platform gives them, and the language the person chose for the app and the host kept, if any (
core.mdsection 12.7). With no list of languages, the person's languages are the one locale the host gives. A kept choice that is not one of the app's own language tags is ignored. Either may change while the app runs:env.language,env.directionandenv.localethen change like any otherenvfield, and the app keeps its state, the person's place in it, typed text and open dialogs. - What a renderer is told about language, with what it draws: the app's shown language (none for an app without
localization) and its direction; for an app withlocalization, the locale the app's formats use, so that numbers and dates the host formats agree with the app's words; and the app's own language tags when it carries more than one, which a language switch offers. Each follows a change of the person's languages or of the kept choice. - For each text of a node whose language the host knows, a renderer is told the direction of that language, and the same for a view's title. A text the definition writes as a plain literal is in the default language; a text written as exactly one
t()call is in the language of the table its entry comes from, so a text that falls back to the default language inside a right-to-left app reads left to right. Any other text (one joined in an expression, a value read from state or typed by the person) has no known language. A node made from a template is judged by the template as the definition writes it. An app withoutlocalizationhas no text of known language. - Where a part is shown in another language or direction than the app around it, the renderer is told the part's language and direction for the region of the part.
- The host's own sheets, dialogs and notices keep the direction of the host's own words, whatever the app's.
- A host that shows an app with more than one language offers the person, in its own interface around the app, the choice among the app's own languages, or to follow the person's own languages. It names each language in that language itself, and keeps the choice for that app on that device.
- Alignment follows the app: a text sits at the start edge of the app's direction. The order inside one text follows the text: the direction of its language when the host knows it, else the direction of its first strong character, else left to right. A text in another direction than the app's keeps its place and reads in its own order.
- The host's own words inside the app (the pages of a table, the amount of a progress bar, a problem with an input) read in their own direction, apart from the app's. App text inside a sentence of the host is held apart from the host's words, so neither can reorder the other. A number, an amount or a date the host formats is kept in one piece: a sign, a currency symbol or a percent sign never parts from its digits.
- An empty text field takes the app's direction and typed text its own. A telephone number, an email address, a web address and a number read left to right in an app of either direction.
- What a host removes from app text before showing it depends on where the text goes:
- Text the host shows in an element of its own keeps U+200C ZERO WIDTH NON-JOINER and U+200D ZERO WIDTH JOINER, which Persian spelling and joined emoji need; the marks U+200E, U+200F and U+061C; and the isolates U+2066 to U+2069 that are balanced on their line once the text is shortened. It loses the embeddings and overrides U+202A to U+202E, an isolate without its partner, U+200B, U+2060 to U+2065 and U+FEFF. Other control characters become spaces.
- Text the host puts into a string (an accessible name, a title, a line it writes as text), an identifier or an address the host shows on a sheet of its own, and a value a person approves or reads back (a confirmation, a record of what was done), keeps the two joiners and loses the marks and the isolates as well. A mark could show the parts of a value, such as the groups of a telephone number, in another order than the value has, and the person would approve what they did not read.
8.3 Core controls#
- dialog. Only the app opens a dialog, by making
opentrue; the person cannot. When the person dismisses it, the host raisesdismissand, whenopenis bound, writesfalse. Whenopenis not bound, the dialog stays open until the app makesopenfalse, usually in itsdismisshandler. A host MAY draw a dialog inside the app's own region rather than above everything on the screen; either way the rest of the view is unavailable while it is open. - form. An input counts toward the innermost form that contains it, through children and slots, and only while it is present, not hidden and not disabled. Inputs inside an embedded part view do not count toward the parent's forms. A
requiredtext input holding only white space counts as empty. The checks forkind(email, phone, url) are the host's and SHOULD accept any value a person could reasonably mean. When the person submits while some input is not acceptable, the host shows the problems at the inputs and does not raisesubmit;validreports the state at all times. - list. A list takes part in moving items when it handles
move, a person may act on it (it is present, not hidden, not disabled, and not behind an open dialog), and it has amoveGroup, isreorderable, or both. Lists that take part, share amoveGroupand are on the same view take items from each other; the same view is one visit of a view, or one part view embedded in it, as it is drawn at that moment, so the lists inside an open dialog move items only among themselves, and a list in a tab that is not selected, or whosewhenis not true, takes no part. A reorderable list also lets a person put an item of it at a place of their choosing; one with nomoveGroupmoves its items only within itself. The host carries out the whole gesture and tells the app once, when the person lets an item go on another list of its group or at another place of a reorderable list, or picks that move among the moves the host offers from the item: it raisesmoveon the list the item lands in, whose handler reads that list's names, withitemthe element of theitemsof the list the item came from, exactly as the app passed it there. Its value is computed from what that list was given (core.md section 7.3). When the list the item lands in is reorderable, the event also carriesindex, the place the item takes among that list's items in the new order, counted from 0, andorder, theitemKeyof every item of that list in the new order, the moved item among them, each exactly as it is in the item, ornullfor an item whose key is missing or is not a short string, a number or a boolean; both arenullwhen that list is not reorderable. Nothing is raised for the list the item is already in, unless that list is reorderable and the item's place in it changes. Where in a list that is not reorderable an item is let go means nothing, also when it comes from a reorderable list: the app orders its lists. A reorderable list shows its items in the order the app passes them, so its handler keeps the order the event gives, asstate.goals.sortBy(g, indexOf(event.order, g.id))does. A host MUST offer, from each item of a list that takes part, a way to move it to each other list of its group that needs no dragging, naming each list by itslabel, or byListfollowed by its position among the lists of its group, counted from 1, when it has none. For a reorderable list it MUST also offer, from each item that can move, a way without dragging to put it one place earlier and one place later, and SHOULD offer the first and the last place; an item sent by such a way to another list of its group that is reorderable takes the first place there. These ways are how a host meets success criterion 2.5.7 of WCAG 2.2, Dragging Movements, which keyboard use alone does not. A host MAY leave out dragging, and offers those ways alone; it MUST NOT leave them out. A host that lets the person drag an item onto a reorderable list shows where the item will stand there before it is let go. A host with no pointer, such as a voice or a text host, offers the same moves in its own manner. A renderer names the item by the identity the host gives it, itsitemKey, and, for a reorderable list, the place by its position among that list's items as they are without the item, from 0 up to their number; the host finds the item in the list it comes from as that list is when the move arrives, so a move that arrives after the app's state changed moves the item the person picked or none, and a place beyond the end of the list as it is then is its end. An item with no key of its own, or one that repeats another's, cannot be moved; other items can be put before or after it. Until the app has answered, the host MAY show the item as on its way; what the app's next tree says is what is shown after. - table. With
completetrue the host sorts and pagesitemsitself. It orders numbers by size and text without regard to case, puts missing andnullvalues last, keeps ties in their original order, and returns to page 1 after sorting. With nopageSize, a table of more than 100 rows is shown 50 at a time, and a table of 100 or fewer is not paged. Withcompletefalse,itemsis the current page in display order: the host shows it as given, neither sorts nor slices it, and raisessortandpagefor the app to answer;pageSizeandtotaltell it how many pages to offer, and withouttotalit offers a next page while the current one is full.selectedholds the keys (values ofitemKey) of the selected rows. When the person picks a row, the host works out the new selection, writes it whenselectedis bound, and raisesselectwith the row and the newselected; in single selection, picking the selected row again unpicks it. A host that lets people select rows presents the table in thegridrole. A column whoseformatiscustomis drawn with thecellslot, and without one its value is shown as text. - tabs. Panels are counted as drawn, after
whenandeach. A panel's caption is the child's accessible label: a group'stitle, an embedded part view's title, and otherwiseTabfollowed by its position counted from 1. - link.
linkdeclares the eventactivate, with payload{}, raised when the person follows it. For aviewlink the host opens the view withinputas anavigatestep would; for aurllink it shows the destination before leaving the app. - canvas. Positions in a scene and in
pointerevents are fractions of the canvas:xof its width from the left edge,yof its height from the top. Lengths that do not follow one axis (a radius, a stroke width, a text size) are fractions of the width, so hit testing usesaspect.targetis theidof the topmost shape with anidunder the pointer, ornull. The keys listed inkeysreach the app while the canvas has the focus; when a canvas that takes keys leaves the drawing while it has the focus and another canvas that takes keys is drawn after it, in its place or in the view shown next, a host SHOULD give that canvas the focus, so that the keyboard stays with the app without a press. A host MUST NOT take the focus from outside its own document for it, such as from the page around the frame the app is drawn in. When a canvas stops taking events while a key it reported pressed is still down (its surface loses the focus, or the canvas leaves the view, is hidden, is disabled, or a dialog is opened over it), the app hears that key's release then, and not again when the key is let go; a release with no press before it is not reported. Apathis one line through itspointsin order, and a path of one point is a round dot as wide as the line;closedjoins the last point to the first, afillfills the inside as if it did (by the nonzero rule where the line crosses itself), and with afillthe line is drawn only whenstrokeis given. The segment that ends at a point is straight, a quadratic curve when the point also hascxandcy, or a cubic curve when it hasc1x,c1y,c2xandc2y(which win overcxandcy); the first point's control points bend the closing segment of a closed path and mean nothing otherwise, and a path that bends holds a fill with two points. A curved point counts as one point. An element ofpointsthat is not an object with two finite numbersxandyis passed over, and a point whose control fields make neither curve is drawn straight; for each the node is reported as degraded, saying how many. A path is under the pointer on its line, with the reach of aline, and inside its fill. Arect'sradiusrounds its corners, never by more than half its shorter side, and the rounded corner is under the pointer only inside its curve. Anellipseis a circle stretched toradiusXandradiusY, both fractions of the width, turned byrotation. Anarcis the part of the circle ofradiusaroundx,yfromfromtoto, in degrees clockwise from pointing right: the part it covers isto - from, nothing when that is 0 or less and the whole circle when it is 360 or more. It is drawn as a line, under the pointer with the reach of aline; with afillit is the wedge between the arc and the center, filled, its outline drawn only whenstrokeis given, and under the pointer inside it. Every shape with a line takesdash(solid,dashed: dashes three widths long with gaps of two,dotted: dots one width long with gaps of one, measured with the ends) andcap(round,flat,square), and arect, apathand anarctakejoin(round,sharp,bevel). What a shape leaves out is drawn as before these fields: aline, apathand anarchave round ends, the others flat ones; apathand anarchave round corners, arectsharp ones; every line is solid. Atexttakesweight:body, the default, oremphasis, the weights of the design's type styles of those names (400 and 600 when the design has none). Thefillof arect,circle,ellipse,arc,pathortextmay be, instead of a color name, a gradient{ "gradient": "linear" | "radial", "stops": [...], "angle": degrees }that runs through two to eight stops across the shape's own box: the box of arect, acircleand anellipse, turned with the shape; the box of anarc's whole circle; the box around apath's line; and for atextits drawn width by itssize. Alineargradient runs alonganglein degrees clockwise (0 from left to right, 90, the default, from top to bottom), from corner to corner of the box, so that its first and its last stop each touch it; aradialone runs from the middle of the box out to its farthest edge, as a circle. A stop is a color name (inside a symbol,giventakes the placement's color, as a plain fill does) or{ "color", "opacity", "at" },opacityandatfrom 0 to 1; stops withoutatare spread evenly between the stops around them that have one, the first at 0 and the last at 1, and a stop never sits before the one ahead of it. A gradient names no color codes and no pixel positions. A stroke is one color. Every shape,groupandusetakesshadow:low,mediumorhigh, how far it seems lifted, drawn with the design system'sshadowtoken of that name in the mode the scene is drawn in (section 6): the shadow fallsoffsetdown, blurred byblur, in the design's ink atopacity, both measured in the design's units whatever the scale or the turn of the groups around it. A shape with a fill casts it from its fill, one without from its line, and agroupor ausecasts one shadow from everything it holds. A shadow never moves anything and never changes what is under the pointer. Agroupdraws itsshapesin a space of its own: positions are measured from the group'sxandy, both axes in fractions of the width (the one place whereyis not a fraction of the height), every position and size is multiplied byscale(default 1, line widths and text sizes included), the whole is turned byrotationdegrees clockwise around the group'sx,y, andopacitymultiplies with each shape's own. The canvas propsymbolsmaps a name to a list of shapes in that space, and auseshape places the symbol it names (symbol) as a group of itsx,y,scale,rotationandopacitywould; a shape of a symbol whosefillorstrokeisgivenis drawn in theuse'scolor, or in the color that field has by default when theusegives none, and inside a symbol ausewhosecolorisgivenpasses on its placement's. Groups and placements nest at most 4 deep together: a group oruseinside four others is not drawn. Auseof a name the symbols do not hold, and one inside a symbol that places that symbol again, directly or through other symbols (the two are in one circle of what places what), is not drawn. For each the node is reported as degraded, saying how many. A pointer on a shape inside a group or a placement is on the outermost group orusewith anidthat holds it, or on the shape itself when none has one; the topmost drawn thing still wins, and a group drawn fully transparent is not under the pointer. A host draws at most 5000 shapes and 50000 path points in all, counted in drawing order and each as often as it is drawn (a group and a placement count as one shape each, and what they hold counts again for every placement), a path that crosses the limit up to it; what lies beyond is not drawn, and the node is reported as degraded, saying how many shapes and path points were left out. A presenter that passes on a scene cut at the limit writes the placement it cuts as a group of the same place, size, turn, opacity and shadow, itsgivencolors written out. The canvas propmotion, and a shape's ownmotionthat overrides it, say how a shape that stays in the scene when it changes gets from its old values to its new ones. A shape stays when the new scene has a shape of the samekindwith itsidat the same level (the scene, or the shapes of the same group with anid, through groups without one); of two with oneidthe first is matched, and a shape without anidnever moves smoothly.none, the default, changes it at once; the name of a motion token of the design moves it over that long, eased so that it starts fast and settles;{ "over": duration, "ease": "smooth" | "linear" }over an ISO 8601 duration of hours, minutes and seconds, at mostPT5S(a longer one is drawn over five seconds and the node reported as degraded). Every number that places or sizes the shape moves (x,y,x2,y2,width,height,r,radius,radiusX,radiusY,from,to,rotationthe shorter way round,scale,opacity,strokeWidth,size), and the points of a path whose number of points stays the same; everything else changes at once. A shape that appears or goes does so at once, and a change while a shape moves starts from where it is drawn. The host is the clock: the app is told nothing of frames, and apointerevent reports shapes where the scene puts them. Where the person asks for reduced motion, or the canvas is not shown, every change is drawn at once; once a motion ends the canvas shows exactly what it would without it. Motion, gradients and shadows are the parts of a scene a host MAY leave out, and it then draws something plain and correct: each change at once, a gradient's shape filled with the color of its first stop at that stop's opacity, and no shadow. Groups and symbols every host MUST draw. In a scene, only thesourceof animageshape can cause a fetch, and it is the address the egress rule applies to (core.md section 6.3), in the scene and insymbolsalike. The canvas'stoolsslot holds the drawing's tools (choices drawn as palettes and icon-only buttons) and their settings (any other control, such as a slider for a pen size); its title, its actions, its tools and their settings are drawn outside the surface, so they never change the positions apointerevent carries. Every color a scene names, and itsbackground, is drawn in the values of the mode the page around it is drawn in, as every other control's colors are, and follows a change of that mode while the app is open; withmode(lightordark) the scene keeps that mode's values whatever the page's, its base values when the design system lacks that mode. A palette among its tools shows each color as the scene draws it. Its title, actions, tools and settings follow the page. A canvas is never mirrored: in an app read from right to left a scene draws the same picture, and positions,pointerevents and keys are as above. Eachtextis ordered by its own first strong character, and itsalignis physical:startis the left end andendthe right end of the text in every language. A canvas that has drawn a scene in this visit of its view and whose node is then the host's placeholder (itssceneor another required prop has no value, because its expression failed or the value does not fit; core.md section 17) SHOULD keep showing the last picture it drew, at its size and in the same place, for a short time (a few seconds at most), so an animation whose scene fails on some frames stutters instead of flashing a placeholder and moving what is around it. When the node is a canvas again within that time, it draws from that node in the same place; when it is not, the placeholder is shown. Meanwhile the kept picture raises no events, as the placeholder raises none, and the host tells assistive technology once, in the placeholder's words, that the part cannot be shown, not at each frame, and does not announce the picture's return. The tree still holds the placeholder, and whatever reads the tree reports it. A canvas that has not drawn in this visit shows the placeholder. - chart. A
unit, the chart's or a series' own, which overrides it, is shown after each plain number exactly as written: a host neither translates it nor makes it plural, and the number keeps the person's notation. A value whose format iscurrencyorpercentis shown without it, and the host reports a view diagnostic.categoryLabelandvalueLabelsay what the axes show (forscatterthe category axis is the horizontal number); apiehas no axes, so they are only read aloud and head the columns of the data's table.orientation: "horizontal"applies tobar, stacked or not: the categories run down the side with the first at the top, and the values along the bottom. A host MAY draw only the first categories of a long horizontal chart when it says so to the person and in a view diagnostic, and the data's table holds them all. Agoalof abar,lineorareachart is drawn across the plot at its value, which the value axis always includes; in a stacked chart it is compared with the whole stack.orientationwith another kind, andgoalwithpieorscatter, are ignored with a view diagnostic. The unit, what the axes show and the goal are part of what assistive technology and a voice surface are told. The plot (its axes, its marks, the way bars grow and the turn of a pie) is drawn left to right in every language and never mirrored, and each text drawn in it keeps the order of its own words; the chart's title, actions, legend and data table follow the direction of the app. - diagram. A diagram keeps its layout in every language: in an app read from right to left its boxes, groups and connections stand where they would in one read from left to right, and each text on it keeps the order of its own words. A symbol that stands before a box's words, such as a
personbox's, stands before them as the app reads. - choice. When every option has a
swatch, or every option has aniconthe host draws, and there are at most 12, the host draws the choice as a palette of color dots or symbol buttons, one picked. It stays one radio group named bylabel: one stop for the keyboard, arrow keys move and pick, and each option is named by itslabel, itsdescriptionread with it. An option's symbol or color the host shows in another form is shown before its label.multiChoicedoes not draw them.requiredconcerns a form, so a host shows no words saying an input is required when it is in no form. - icon. Every host draws a symbol for each name of the icon vocabulary (section 1). An icon whose
namethe host does not know shows no symbol; itslabel, if any, is still given to assistive technology. - actions. The
actionsslot ofgroup,chart,table,list,canvasanddiagramis drawn on the line of the control's title (a group'stitle, the others'label; atable,listorcanvasthat has actions shows itslabelas that title), at its trailing end, or under the title when the line has no room for both. Analertdraws its actions after its message, apart from its control to dismiss it. Assistive technology meets them after the title and before the content, as the control's own. A surface without a visual form offers them by their labels after the control's summary. - button. With
iconOnlytrue and aniconthe host draws the icon alone; thelabelstays the accessible name and is shown when the pointer rests on the button or keyboard focus is on it. Without aniconit draws the label (prop.iconOnlyWithoutIcon). While the handler of a press has not finished, the host does not raisepressagain from the same button, and after a short wait shows that the button is working, without changing its size; a form's submit action behaves the same. A label that does not fit the button's place wraps onto more lines. - text.
formatisplain(the default) ormarkdown. A plain text shows itsvalueas it is. A markdown text reads the subset of Markdown below, the same on every host, and shows everything else as the characters it is.stylesets the size and weight of ordinary text in both formats.
Lines and blocks. The value is split into lines at \n, \r\n and \r; a tab at the start of a line counts as spaces to the next multiple of four. A line of only spaces is blank. A line indented by four spaces or more starts no block. Blocks are read in the order below; a paragraph is the default.
| Construct | Written | Shown |
|---|---|---|
| Paragraph | Lines of words, ending at a blank line or at a line that starts another block |
A paragraph. Each line break inside it is kept as a line break. Spaces at the start and end of each line are dropped. |
| Heading | # Title, ## Part, ### Detail: one to six #, then a space or the end of the line |
A heading of level 1, 2 or 3; four to six # are level 3. A closing run of # after a space is dropped. #tag with no space is a paragraph. |
| Rule | ---, *** or ___: three or more of one of these, with spaces between them or not, alone on the line |
A horizontal rule. Under a paragraph it is a rule, never a heading. |
| Quotation | > Words: lines that start with >; one space after it is dropped |
A quotation holding the blocks read from those lines. It ends at the first line that does not start with >. |
| List | - one, * one, or 1. one (up to nine digits and a .), then a space or the end of the line |
A list; numbered lists start at the first item's number. An item holds its first line and the lines after it indented by at least two spaces, or to the column of its text, read as blocks; a blank line inside it is kept when the next line is indented so. The next item of the same marker (-, *, or a number) continues the list, also after blank lines; another marker starts another list. A list inside an item is drawn one level in; a list inside that, and deeper, is drawn at that second level, its items following the item they were in. A numbered item ends a paragraph only when it is numbered 1, and an item with no text never does. |
| Block of code | ``` or more backticks, a language word after them allowed and ignored, then the lines up to a line of at least as many backticks |
The lines exactly as written, in a monospaced face, read from left to right. Without a closing line, the block runs to the end of the text. |
| Table | A row with \|, followed by a row of cells of dashes, each with an optional : at either end, with the same number of cells: \| Name \| Cost \| then \| --- \| ---: \|; then rows up to a blank line or a line without \| |
A table with that header row; :---: centres a column and ---: aligns it to the end. A pipe at the start and end of a row is optional. A row with fewer cells is filled with empty ones, and cells beyond the header's are dropped. A pipe with a backslash before it, or inside code in a line, does not divide cells. A table ends a paragraph. |
In a line. Inside paragraphs, headings, list items and table cells:
| Construct | Written | Shown |
|---|---|---|
| Code | `code`: a run of backticks up to the next run of exactly as many |
The characters as written, in a monospaced face; line breaks inside become spaces, and one space at each end is dropped when both are there. Nothing inside is read. Without a closing run the backticks are characters. |
| Link | [words](https://example.: an address with no spaces, which may hold one pair of parentheses |
The words as a link to the address. A link holds no other link. |
| Address | <https://example.: http://, https://, mailto: or tel: inside angle brackets |
The address as a link to itself. |
| Strong | **words** |
Strong words. |
| Emphasis | *words* or _words_ |
Emphasized words. ***words*** is both. |
| Escape | \*: a backslash before an ASCII punctuation character |
The character itself, read as nothing else. |
A run of * or _ opens when the character after it is not white space and, when it is punctuation, the character before it is white space or punctuation; it closes when the same holds the other way round. A single * or _ neither opens nor closes inside a word, so 2*3*4 and snake_case stay as they are; ** may sit inside a word, but not between two ASCII letters or digits, so 2**10 stays as it is. A * or _ with white space on both sides is a character. A closer pairs with the nearest open run of the same kind (*, **, *** or _), and runs opened between them stay characters. Runs of four or more *, and two or more _, are characters. Code, links and addresses are read before emphasis, and emphasis never crosses a link's words.
Shown as its characters: HTML of any kind and character references such as &; images (, the whole of it); reference links, footnotes and task lists; links whose brackets are not followed at once by (address); underline headings, indented code, ~~~ fences, + lists, numbers followed by ); and anything else not listed above.
Links. A link's address is a link only when core:link would follow it as a url (http, https, mailto or tel, with no user name or password before the host, no spaces or control characters, at most 2048 characters); otherwise its words are shown as text, not as a link. A person must activate it; the host shows where it leads (the address's host, or the address of an email or phone link) before leaving, never fetches it beforehand, and a host that holds links holds these the same way. Nothing in a formatted text is fetched, loaded or run: it never opens a view, runs an action or writes state, and an image is never loaded because of it.
Bounds. A host reads at most the first 20,000 characters (characters), keeps at most 500 blocks and list items (blocks), reads quotations and list items at most 5 deep (nesting; deeper > and list markers are shown as characters), and keeps at most 100 rows (tableRows) and 12 columns (tableColumns) of each table. What is beyond a bound is not shown, the text says so where it ends, and the node is reported as degraded with a view diagnostic. Reading is linear in the length of the text.
Other surfaces. A heading in a text is exposed to assistive technology below every heading the view itself draws; lists are lists and tables are tables with header cells. A surface that cannot format shows or speaks the text without its markup; markup is never read aloud as symbols, and a table is spoken as a summary of its columns and number of rows.
For example, this value:
## Trip
We fly on **Friday**; the code is `LX 1234`.
1. Pack
2. Leave
> Gates close early.
| Day | Cost |
| --- | ---: |
| Friday | 240 |
Details at [the airline](https://example.com/flights).
is a heading of level 2, a paragraph with strong words and code, a numbered list of two items, a quotation, a table of one row whose second column is aligned to the end, and a paragraph with a link that shows it leads to example.com.
- fileInput. File references in
valuecome only from the host, from its file chooser or a capture. Choosing a file, or taking a photo or a recording, throughfileInputis the person's own act and needs no grant; reading the file's contents goes through a capability.
9. Core capability behaviour#
The capability contracts of the core catalog settle these points, and their descriptions in the catalog say the same.
Personal capabilities. files, media, location, clipboard and share have the personal trait; notify, scheduler, http, directory and records do not (core.md section 6.4.2).
Given by use. The scopes files.pick, files.read, files.save, media.camera, media.microphone and share.send are given by use (section 4): under each, a person chooses, captures, saves or sends at that moment in the host's interface, or the app reads a file that a person gave it. A request for them alone is not asked. Every other core scope is asked, clipboard.write, clipboard.read and location.current included, since under them the app acts without the person doing anything at the time, unless the host's own provider keeps what is done under it inside the app (core.md section 6, "When a request is asked").
The current user. Where a contract speaks of the current user (notify.send, notify.sendTo, directory.me, and directory.manager without of), it means the person of the acting principal (core.md section 6.1). An agent or the app is never the current user. When the acting principal has no person, the operation fails with capability.failed.
notify. send and sendTo take an optional viewInput, the input for view: opening the notification opens that view with that input. When the view does not exist or the input does not fit its input field map, the host opens the start view. sendTo sends on the current user's behalf.
scheduler. Its scope lets the app run while nobody has it open: holding a grant on it permits every rules, flow after timers and timed source refreshes to run unattended, and the scope's description says so plainly to the approver. wakeAt with a time that has passed is due at once and returns the current time. A wakeAt whose key is already pending replaces the earlier wake. Wakes are kept by the instance, not by a session, and each wake is delivered once. A wake belongs to the person on whose behalf it was scheduled: the rules it fires act on that person's behalf, with the values of one of that person's active sessions when there is one, and otherwise with no session, the app running unattended under the scheduler grant (core.md section 6.4.4). Wake keys are per instance, so an app that keeps a wake for each person includes user.person.id in the key. Within an instance, wakes belong to the definition whose steps scheduled them, the app itself or one of its parts: each has its own keys, so neither a part nor the app that includes it can replace or cancel a wake of the other or of another part, also when the part's capability is mapped to the including app's, and a wake event reaches only the rules of the definition that scheduled it. The event's at is the time wakeAt returned. A host supports at least 100 pending wakes per instance and times up to ten years ahead; a request beyond what it supports fails with capability.failed.
http.
- Paths are taken literally and never normalized, so a grant's
wheresees exactly the path the service receives. A path that contains a dot segment (.or.., also percent-encoded), an encoded/,\,.or%, a\, a control character, or any character outside the path characters of RFC 3986 is refused, and the call fails withcapability.failed. Just before sending, the host checks that the address it built has the configured origin. - Redirects are never followed. A 3xx response is returned to the app as it is; where the platform cannot return it, the call fails with
capability.failed. - Headers an app may not set are refused, not dropped: the call fails with
capability.failed. They arehost,cookie,cookie2,set-cookie,set-cookie2,connection,keep-alive,transfer-encoding,te,trailer,upgrade,content-length,expect,origin,referer,via,forwarded,max-forwards,http2-settings,accept-encoding,accept-charset,date,dnt,access-control-request-headers,access-control-request-method,x-real-ip,x-original-url,x-rewrite-url, any header starting withproxy-,sec-orx-forwarded-, and the method-override headersx-http-method-override,x-http-methodandx-method-override, which would let agetunderhttp.readact as a write. set-cookieheaders are removed from responses. A credential the host attached that the service echoes back is replaced with[withheld].- The response
bodyisnullwhen the response has no content; the parsed value when the response declares a JSON media type (application/json, orapplication/followed by a name ending in+json) and parses; and otherwise the content decoded as UTF-8 text, with invalid sequences replaced. Binary content therefore cannot be read throughhttp.
files. An instance can read only file references the host issued to it: by pick, by save, by a capture (media, fileInput), or for a file an agent handed to the host (core.md section 5). Any other reference fails with capability.failed, as if the file were not available. How long a reference stays readable, and what a reference kept in shared state shares, is set out in core.md section 5. as: "records" reads and writes comma- or tab-separated text, every value as text.
records.
- Field names in
filter,sortandgroupByname top-level fields of a record. A missing field reads asnull. eq,neandincompare exactly, with no conversion between kinds;intakes a list of values.lt,lte,gtandgtehold only between two numbers or two strings.containsholds when the field and the value are both strings and the field contains the value once both are mapped to lower case by the Unicode default case conversion with no locale (what ECMAScript'sString.prototype.toLowerCasegives), with no normalization and no folding of accents:"Refund for a cancelled booking"contains"refund"and"REFUND"but not"réfund".eq,ne,inand the ordering comparisons mind case.- Sorting uses one order across kinds: missing and
nullfirst, thenfalsebeforetrue, then numbers by size, then strings by code point, then lists and objects. Ties keep the order in which the records were created. listdeclarespaging(cursor,next,items). A cursor is good only for the listing that produced it. A record that exists throughout the paging and keeps its sort values is listed exactly once.total, when given, counts every record that passes the filter, not only the page.counttakes an optionalfilterand returns{ "count" }, the number of records that pass it.aggregatetakes an optionalfilter, an optionalgroupBy(a list of field names; without it every record is in one group),measures(an object from a name to{ "op", "field" }, whereopiscount,sum,min,maxoravg, andfieldis required for everyopexceptcount, which counts the records of the group) and an optionallimit(the most groups returned, 1 to 1000, default 100). It returns{ "groups": [ { "key", "values" } ], "truncated" }:keymaps eachgroupByfield to the group's value,valuesmaps each measure name to its result, groups come in ascending order of their keys in the sort order above, andtruncatedistruewhen more groups existed thanlimit.sumandavguse only number values, andminandmaxuse the sort order above over values that are notnull; with no such valuessumis 0 and the others arenull.countandaggregatearereadoperations underrecords.read.changedis delivered after the write that caused it.