@agentshouse/skills 0.1.0-ca6f30223cbaf → 0.1.0-ca8e5fc0a1e54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +4 -2
  2. package/agent-instructions.json +12 -5
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.js +6 -3
  5. package/guide/agent-functions/work-on-ticket.md +5 -7
  6. package/guide/apps/build.md +1 -0
  7. package/guide/apps/chat.md +37 -8
  8. package/guide/apps/client.md +1 -1
  9. package/guide/apps/content-safety.md +3 -2
  10. package/guide/apps/data.md +2 -2
  11. package/guide/apps/design-functions.md +10 -0
  12. package/guide/apps/design-load.md +14 -0
  13. package/guide/apps/design-look.md +11 -0
  14. package/guide/apps/design-schema.md +12 -0
  15. package/guide/apps/design.md +12 -0
  16. package/guide/apps/example-function.md +1 -1
  17. package/guide/apps/example-tasks-2.md +21 -21
  18. package/guide/apps/example-tasks-3.md +2 -2
  19. package/guide/apps/example-tasks.md +6 -6
  20. package/guide/apps/function-times.md +10 -0
  21. package/guide/apps/functions.md +7 -7
  22. package/guide/apps/local-first.md +6 -6
  23. package/guide/apps/local-query.md +4 -4
  24. package/guide/apps/page.md +4 -4
  25. package/guide/apps/query-house.md +31 -0
  26. package/guide/apps/room-drafts.md +19 -12
  27. package/guide/apps/runtime-api.md +17 -11
  28. package/guide/apps/runtime-conversations.md +38 -0
  29. package/guide/apps/runtime-files.md +5 -3
  30. package/guide/apps/runtime-refusals.md +4 -2
  31. package/guide/apps/runtime.md +1 -0
  32. package/guide/apps/search.md +1 -1
  33. package/guide/apps/start.md +3 -0
  34. package/guide/index.md +2 -4
  35. package/guide/owner-rules.md +3 -5
  36. package/guide/reference/access-level.md +1 -1
  37. package/guide/reference/agent-function.md +4 -6
  38. package/guide/reference/app-manifest.md +3 -1
  39. package/guide/reference/group-post.md +7 -0
  40. package/guide/reference/inbox-types.md +7 -0
  41. package/guide/reference/schema.md +21 -12
  42. package/guide/reference/telegram-link.md +11 -0
  43. package/guide/reference/triggers.md +7 -5
  44. package/guide/reference/wayfinding-types.md +7 -0
  45. package/guide/sites/build.md +4 -2
  46. package/guide/sites/entry-data-contract.md +11 -2
  47. package/guide/sites/first-load.md +15 -0
  48. package/guide/sites/functions.md +13 -0
  49. package/guide/sites/payments-stripe-2.md +83 -0
  50. package/guide/sites/payments-stripe-3.md +67 -0
  51. package/guide/sites/payments-stripe-4.md +96 -0
  52. package/guide/sites/payments-stripe.md +63 -0
  53. package/guide/sites/payments.md +13 -0
  54. package/guide/sites/runtime.md +2 -2
  55. package/guide/skills/build-app.md +12 -1
  56. package/guide/skills/house-onboarding.md +2 -2
  57. package/guide/skills/prototype-app.md +3 -1
  58. package/owner-rules-earlier.json +3 -1
  59. package/package.json +1 -1
  60. package/upstream.json +2 -2
package/README.md CHANGED
@@ -14,7 +14,8 @@ The Skills agents.house serves its agents, and the texts its agents read.
14
14
  `agent-functions/` holds the Agent functions agents.house writes into every Private Room, frontmatter and
15
15
  all. `owner-rules` is the Owner rules' text, and `owner-rules-earlier.json` the SHA-256 of every
16
16
  earlier text.
17
- - `agent-instructions.json` is the lines that open an agent's first prompt.
17
+ - `agent-instructions.json` is the lines that open an agent's first prompt; its `routing` lines are
18
+ the ones agents.house's MCP server instructions carry too.
18
19
 
19
20
  ```ts
20
21
  import { OWNER_RULES, listSkills, readSkill } from '@agentshouse/skills';
@@ -23,7 +24,8 @@ for (const { name } of listSkills()) console.log(name, readSkill(name).length);
23
24
  console.log(OWNER_RULES);
24
25
  ```
25
26
 
26
- `agentInstructions(houseRef, copies)` returns the first prompt's lines, which name no Local copy,
27
+ `agentInstructions()` returns the first prompt's lines, which name no Local copy, `ROUTING_INSTRUCTIONS`
28
+ its routing lines,
27
29
  `GUIDE` every Guide page with its path, title, first line and text and
28
30
  `EARLIER_OWNER_RULES_SHA256` the earlier texts' digests.
29
31
 
@@ -1,9 +1,16 @@
1
1
  {
2
- "lines": [
2
+ "opening": [
3
3
  "From House:",
4
- "Work with House through the `house` CLI: run `house --help`, and `house run_command '{\"command\":\"guide/open\"}'` opens `index`, the root page of House's guides and formats.",
5
- "To give the User a file, upload it with `house upload` and link it; for an App, a Site or a website, follow the Guide from `index` with `guide/open`. Never start a server.",
6
- "Optional per-Room instructions: `/rooms/private/rooms/<handle>/AGENTS.md`.",
7
- "For another Agent's help, `agent-functions/send` naming one of the Room's Agent function cards under `house/agent-functions/`, or the Agent and what you ask, as its Trust level there allows; its mail comes back into this conversation."
4
+ "Work with House through the `house` CLI, `house <tool> '<arguments as JSON>'`: `house --help` lists the Tools and `house help <tool>` names a Tool's arguments."
5
+ ],
6
+ "routing": [
7
+ "Read with `shell` and `inspect`. Write with `files_batch` and `records_append`.",
8
+ "For anything else, `find_command`, then `run_command`.",
9
+ "Optional per-Room instructions: `/rooms/private/rooms/<handle>/AGENTS.md`."
10
+ ],
11
+ "closing": [
12
+ "`house run_command '{\"command\":\"guide/open\"}'` opens `index`, the root page of House's guides and formats.",
13
+ "A file reaches the User as a Room Path written with `house upload` and linked in the answer. House serves an App, a Site or a website built by the Guide from `index` (`guide/open`), with no server of your own.",
14
+ "For another Agent's help, `agent-functions/send` naming one of the Room's Agent function cards under `house/agent-functions/`, or the Agent and what you ask, as its Standing answers there allow; its mail comes back into this conversation."
8
15
  ]
9
16
  }
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare const GUIDE_ROOT = "index";
16
16
  export declare const GUIDE: readonly GuidePage[];
17
17
  export declare const OWNER_RULES: string;
18
18
  export declare const EARLIER_OWNER_RULES_SHA256: readonly string[];
19
- export declare function agentInstructions(_houseRef: string, _copies: readonly string[]): string[];
19
+ export declare const ROUTING_INSTRUCTIONS: readonly string[];
20
+ export declare function agentInstructions(): string[];
20
21
  export declare function listSkills(): readonly Skill[];
21
22
  export declare function readSkill(name: string): readonly SkillFile[];
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ const TREE = join(PACKAGE, 'guide');
8
8
  const PAGE = '.md';
9
9
  const FRONTMATTER = /^---\n[\s\S]*?\n---\n\n?/u;
10
10
  const HEADING = /^# /u;
11
+ const LIST_ITEM = /^\s*[-*+] /u;
11
12
  export const GUIDE_ROOT = 'index';
12
13
  const OWNER_RULES_PAGE = 'owner-rules';
13
14
  function packaged(name) {
@@ -15,7 +16,8 @@ function packaged(name) {
15
16
  }
16
17
  function guidePage(file) {
17
18
  const text = readFileSync(join(TREE, file), 'utf8');
18
- const [heading = '', , line = ''] = text.replace(FRONTMATTER, '').split('\n');
19
+ const [heading = '', , ...rest] = text.replace(FRONTMATTER, '').split('\n');
20
+ const line = rest.find((held) => held !== '' && !LIST_ITEM.test(held)) ?? '';
19
21
  return {
20
22
  path: file.slice(0, -PAGE.length).split(sep).join('/'),
21
23
  title: heading.replace(HEADING, ''),
@@ -33,8 +35,9 @@ export const GUIDE = readdirSync(TREE, {
33
35
  export const OWNER_RULES = GUIDE.find((page) => page.path === OWNER_RULES_PAGE).text;
34
36
  export const EARLIER_OWNER_RULES_SHA256 = JSON.parse(packaged('owner-rules-earlier.json'));
35
37
  const INSTRUCTIONS = JSON.parse(packaged('agent-instructions.json'));
36
- export function agentInstructions(_houseRef, _copies) {
37
- return [...INSTRUCTIONS.lines];
38
+ export const ROUTING_INSTRUCTIONS = INSTRUCTIONS.routing;
39
+ export function agentInstructions() {
40
+ return [...INSTRUCTIONS.opening, ...INSTRUCTIONS.routing, ...INSTRUCTIONS.closing];
38
41
  }
39
42
  export function listSkills() {
40
43
  return readdirSync(SET, { withFileTypes: true })
@@ -1,15 +1,13 @@
1
- ---
2
- description: Work the Wayfinding ticket this request names, from its Question to its Answer.
3
- input: The ticket to work on.
4
- ---
5
-
6
1
  # Work on ticket
7
2
 
3
+ - **Description**: Work the Wayfinding ticket this request names, from its Question to its Answer.
4
+ - **Input**: The ticket to work on.
5
+
8
6
  The Agent function an Agent runs when a person sets a Wayfinding ticket in progress with that Agent as its assignee.
9
7
 
10
8
  Work the one ticket this request names, then stop:
11
9
 
12
- 1. Open the `wayfinding-ticket` the request names and set its `conversation` to the id of this conversation, which House's first message names.
10
+ 1. Open the `wayfinding-ticket` the request names and set its `conversation` to the id of this conversation, the one `conversations/active/list` marks `this`.
13
11
  2. Work it by its `kind`: for `research`, find out and say where you found it; for `prototype`, build the smallest thing that answers its Question; for `grilling`, ask your User until its Question is settled; for `task`, do what it asks.
14
- 3. Write what you found or made in its Answer section and set its `status` to `done`.
12
+ 3. Write what you found or made as its Answer and set its `status` to `done`.
15
13
  4. Start no other ticket, not even one this ticket unblocks.
@@ -4,6 +4,7 @@ How to build an App over your User's Rooms and publish it, one page per step.
4
4
 
5
5
  An App is a web page over your User's Rooms, for your User and whom they share it with (`shares/create`). House serves the built files and gives the page the App runtime, which holds every bound Room in the browser and syncs it with House. There is no server, backend or House API of yours to call.
6
6
 
7
+ - [Design an App](apps/design)
7
8
  - [Start an App](apps/start)
8
9
  - [An App's data](apps/data)
9
10
  - [Local first](apps/local-first)
@@ -8,16 +8,45 @@ no dependency. `const chat = await houseBridge.chat.mount(element, options)`, on
8
8
  object House hands the page as `window.houseBridge`, which `houseBridge()` of
9
9
  `@agentshouse/app-bridge` returns, draws it in `element` over the App's own client and
10
10
  resolves to a handle: `chat.update(options)` replaces its options and `chat.unmount()`
11
- removes it. `conversation` opens one, `null` for a
12
- new chat, `agent` is the Agent a new chat goes to, `showChats` adds its conversation list,
13
- `width` is `full` (the element), or `3/4`, `1/2` or `1/3` of the window docked at its right
14
- edge, whole on a narrow window, `onOpen` hears each conversation it opens as `{
15
- conversation, agent }`, and `onLink` takes a link without a scheme in place of the browser.
11
+ removes it. It fills the element and lays itself out by the width it gives: the list of the
12
+ User's Agents and their chats or one chat on a narrow element, and on a wider one the list
13
+ beside the chat while the User shows it by its toggle, closed at first beside an open chat and
14
+ open where none is, the conversation keeping its width where the element has room for both.
15
+ With no chat open it shows what
16
+ asks the User and what works now. `conversation` opens one chat, and with it `null` the Chat
17
+ opens a new chat with `agent`, the Agent it goes to, or the list with neither. `onOpen` hears
18
+ each chat it opens as `{ conversation, agent }`, and both `null` when the User goes back to the
19
+ list, and `onLink` takes a link without a scheme in place of the browser.
20
+ Or mount it as the Chat button, which takes no element:
21
+ `const button = await houseBridge.chat.mountButton(options)` draws House's dot at the
22
+ window's bottom-right corner, which counts what asks the User or, while nothing does, the chats
23
+ that replied since the User opened them, and breathes while a turn runs; pressing it opens the
24
+ Chat in a sheet above the page, and pressing it again hides it. With `agent` among the options
25
+ the dot's first press opens it on a new chat with that Agent instead of a chat kept from an
26
+ earlier visit, and later presses reopen the chat it last showed; the sheet stays hidden until
27
+ the first press. The dot stays in view over the
28
+ sheet, which the User moves, resizes up to the window's edges and lets fill the window, and
29
+ whose list, closed at first, widens it to the left by the list's own width; the page under it
30
+ never changes, so leave nothing of the page to make room for it.
31
+ `button.open(target)` opens the sheet, on `{ conversation }` or on a new chat with
32
+ `{ agent }`, or as it was with no target, and with `docked: true` docked at full height along
33
+ the window's right edge; `button.hide()` hides it, keeping its chat, scroll and typed text;
34
+ `button.update(options)` and `button.unmount()` work as for a page, with `onOpen` and
35
+ `onLink`. To open on text written in, write it as the chat's draft through the runtime's
36
+ `chatDraft` first, keyed `new:<agent>` for a new chat. In the sheet the input's + holds This
37
+ page, which attaches the page's Page metadata to one message: a new chat's first message starts
38
+ with it ticked. Mount one button per page.
39
+ In either form the Chat draws inside its own shadow root, so no rule of the App's stylesheet
40
+ reaches it. `chat.mount` needs an element that can hold a shadow root, such as a `div` or a
41
+ `section`, and rejects on a `li`, a `td` or a `form`.
16
42
  Theme its own styles with CSS custom properties on the element or an ancestor:
17
43
  `--chat-background`, `--chat-surface`, `--chat-text`, `--chat-text-muted`,
18
44
  `--chat-accent`, `--chat-line`, `--chat-attention`, `--chat-danger`, `--chat-font`,
19
45
  `--chat-font-mono`, `--chat-font-size`, `--chat-radius` and `--chat-density` (a factor for
20
- spacing); an unset one keeps House's light or dark look. It shows conversations only where
21
- the release declares them; otherwise it lists no conversation and no Agent. A secret
46
+ spacing); an unset one keeps House's light or dark look. For the Chat button, which takes no
47
+ element, set them on the document's root element. Its dot is House's and takes none of them.
48
+ It shows conversations only where the release declares them;
49
+ otherwise it lists no conversation and no Agent. A secret
22
50
  question is never answered here; typed answers live in the Presentation State members named
23
- `typed:…`: leave them.
51
+ `typed:…`, and the sheet's size, place, whether it fills the window and its open chat in
52
+ `chat:sheet`: leave them.
@@ -18,4 +18,4 @@ and returns `{ state: 'loading' }` until the topic's first value arrives, then `
18
18
  parts)`, which saves through `saveParts` and rejects with a recorded failure.
19
19
  `saveWritten(room, roomDrafts)` saves Room Drafts the App wrote, each named with the
20
20
  revision its last write returned: one another tab wrote since is refused as `stale`, and
21
- nothing is saved. React-admin and Refine Apps use `@agentshouse/mdruntime-families`.
21
+ nothing is saved.
@@ -10,8 +10,9 @@ images and other resources only from origins the Provider's policy allows. An ag
10
10
  never read the authorization, load code from a Room, call the Provider directly, or rebase
11
11
  a refused Change Batch.
12
12
 
13
- MD UI uses semantic HTML, is fully operable from a keyboard with labelled controls and
14
- the browser's own focus mark, and lays out from a 360 pixel wide viewport to a desktop.
13
+ MD UI uses semantic HTML, is fully operable from a keyboard with labelled controls, styles
14
+ no focus, removes the browser's own focus ring and takes no focus by itself, and lays out
15
+ from a 360 pixel wide viewport to a desktop.
15
16
  Its strings are English only, dates and numbers follow the browser locale, and content is
16
17
  never translated. Light and dark themes come from CSS custom properties, defaulting to the
17
18
  browser's preference and respecting an App's override. What an agent adds carries none of
@@ -2,8 +2,8 @@
2
2
 
3
3
  How an App keeps what it shows as typed documents in the Rooms bound to it.
4
4
 
5
- - Design the Room schema first. Each thing the App shows is one Markdown document in a Room: its frontmatter `type` names its MD type, the rest of its frontmatter holds the fields, and long text goes in `##` sections. `schema.yaml` declares the types ([Schema](reference/schema)).
6
- - Keep each type in its own folder, such as `tasks/`, and read it by `pathPrefix`: a query naming `types` fails with `unknown-type` while no bound Room declares them.
5
+ - Design the Room schema first. Each thing the App shows is one Markdown document in a Room: its frontmatter `type` names its MD type and its body writes the values: its `name` as the `#` line, each short value as a `- **Label**: value` line and long text under its own heading ([Schema](reference/schema)). `schema.yaml` declares the types ([Schema](reference/schema)).
6
+ - Keep each type in its own folder, such as `tasks/`, and read it by `pathPrefix`. A query naming `types` fails with `unknown-type` over bound Rooms none of which declares them, and answers `{ pending }` instead while the App reaches no bound Room yet; an observed query that has already answered answers `{ pending }` while its bound Rooms refuse it, and answers again once they declare what it names.
7
7
  - Link types with `reference` fields instead of copying values; a query follows them with `hop` and `backlinks`.
8
8
  - `app.json` `room_slots` names the Rooms the App needs, each with `access` `read` or `write` and the `types` it uses ([App manifest](reference/app-manifest)). Bind Rooms with `apps/bindings/set`; App code cannot bind and reaches only bound Rooms, so it opens `bridge.ceremony('/bind/<app_ref>?slot=<name>')`, the House page where your User binds Rooms, which returns to the App.
9
9
  - A bound Room must hold each slot type identically in its own `settings/schema.yaml`, beside any other types, or its binding warns the User who bound it, and `apps/bindings/list` names that release and slot in its `mismatch` line, to the App's owner too. Write it with `files_batch` before binding; `rooms/create` makes a new Room.
@@ -0,0 +1,10 @@
1
+ # Which function does what
2
+
3
+ Which part of House does each kind of an App's work, and what each run costs.
4
+
5
+ - **The page** reads and writes the bound Rooms on the device, offline too, and runs only while someone has it open ([Local first](apps/local-first)).
6
+ - **An App function** runs on House's servers when a Trigger of its Room fires, with no page open and no model. It reads and writes that Room and calls the services `external_origins` lists, within <function-time> and <function-memory> a run. It does what a script can: computing, filing, copying, counting, scheduling, calling a service ([App functions](apps/functions)).
7
+ - **An Environment function** is a script your User kept for one of their computers, which Kit runs there as them. It does work that needs that computer, its files or its logins. A Trigger of their Private Room, their Run now or `environments/functions/run` starts one; a Trigger of any other Room never does ([wizard](skills/wizard)).
8
+ - **An Agent function** starts a conversation of one of your User's Agents, which reads, judges and writes in minutes rather than milliseconds. Every run spends your User's own provider budget, and nothing bounds how many a Room's Triggers start. It does what needs judgment: reading a message, answering it, deciding what a document means ([Agent function](reference/agent-function)).
9
+ - **A job that needs judgment in one step** splits: an App function does the rest, and an Agent function only that step, writing its answer into the Room, where a Trigger hands it on to the App function ([Agent function](reference/agent-function)).
10
+ - **With no page open**, work happens only through a Trigger whose action notifies someone or runs one of these ([Triggers](reference/triggers)).
@@ -0,0 +1,14 @@
1
+ # Designs that load House
2
+
3
+ What an App's saves, Triggers and functions cost House's servers and every device holding its Rooms.
4
+
5
+ - **A save** stores the document's whole new text as a revision, tests it against every Trigger of its Room inside the write, streams the whole text to every device holding the Room and counts once against the saver's Write limit, whatever its size. A log or a state kept in one growing document costs its whole size on every change: keep one small document per thing.
6
+ - **Saving as someone types**, or on a timer, writes each time; the Room Draft keeps what they type until they save ([Room Drafts](apps/room-drafts)).
7
+ - **Every device** holding a Room at the Keep or Open level holds all of its text ([Access level](reference/access-level)), so records written by the thousand fill every holder's device; a file goes in as a file ([files](apps/runtime-files)), never as text in a document.
8
+ - **A Trigger** whose change test is any edit, `changes: "text"`, acts on every save of a document it matches, while a field's change, or the default firing as a document starts to match, acts once per change that matters ([Triggers](reference/triggers)).
9
+ - **A function's writes** fire Triggers, its own included: one whose write matches its own Trigger runs again on each run until that Trigger's <trigger-events-per-hour> Events in the hour are spent, so write what it writes so that its Trigger does not match it ([App functions](apps/functions)).
10
+ - **A function run** reads, on every Event, every document of the types, folders and paths its query names from House's database, within <function-memory>, and one Room owner's runs take at most <function-owner-slots> slots on a server at once: name the narrowest folder or paths, or read a summary document the function keeps ([App functions](apps/functions)).
11
+ - **One Trigger's Events** run one after another, so a busy Trigger builds a queue ([App functions](apps/functions)).
12
+ - **An Agent function run** spends your User's provider budget each time ([Agent function](reference/agent-function)).
13
+ - **Changing a field's `title`** relabels every document of its type in one write ([Schema](reference/schema)).
14
+ - **A query naming no `types`, `pathPrefix` or `paths`** reads every document of its Rooms on the device: name the narrowest and select only what a screen shows ([Local Query](apps/local-query)).
@@ -0,0 +1,11 @@
1
+ # An App's look
2
+
3
+ What House draws around an App's page, and what the App sets for its look.
4
+
5
+ - **The page is the App's own**, drawn and run by the App ([An App's page](apps/page)). Over it House draws only its wait until the page shows its place, and the dialog asking a User who does not own the App to allow a browser feature or House act the App uses for the first time.
6
+ - **The Chat**, where the page mounts it, draws in the App's frame: the Chat button's dot in House's look, and the Chat in its own, which the `--chat-*` properties theme ([The Chat](apps/chat)).
7
+ - **The design system's tokens**: mdui's `style.css` holds House's design tokens as CSS custom properties, light and dark: its greys, type sizes, spacing, radii and motion. An App built on them looks like House; changing them gives it a look of its own. The design system itself is not published, so mdui's tokens are how an App takes it.
8
+ - **Light and dark**: House's screens around the page, such as its wait until the page shows its place, follow the device's light or dark setting, as `prefers-color-scheme` does.
9
+ - **The top colour**: declare the page's top colour as `theme_colour` in `app.json`, and `theme_colour_dark` where the dark one differs ([App manifest](reference/app-manifest)). An installed App's title bar and a phone's top strip take it, and House's white or near-black ground without it.
10
+ - **The icon** is the owner's setting, never the release's: one image in the browser tab, the panel and on a home screen. It is the App cube in the App's colour until one is set, then a generated one from one to four colours or the owner's own square PNG or SVG, through `apps/tab-icon/set`; `bridge.setTab({ title, icon })` changes the open tab's title and icon until the next load.
11
+ - **No focus mark**: House's own screens draw none, and [An App's page](apps/page) says how a page removes the browser's ring.
@@ -0,0 +1,12 @@
1
+ # Schemas that read well
2
+
3
+ How an App's types make documents that read well as Markdown, to people and agents alike.
4
+
5
+ A typed document writes its values as Markdown, so its schema decides how it reads; [Schema](reference/schema) holds the format.
6
+
7
+ - A field named `name` is the document's `#` line, and a type with none writes documents with no title line.
8
+ - `title` on a field is the label its line shows, and a field with none shows its key.
9
+ - Each field takes one JSON type. A short value is one line, a yes or no a checkbox line and a `reference` a link; Markdown text (`contentMediaType: text/markdown`) and a value that may hold a line break take a heading of their own; a value of no single type is written as a fenced `json` block.
10
+ - Rows of short values read as a table, and a list of groups that is no table takes one heading per item, named by its `name`.
11
+ - Nest values at most five levels deep, each list's items counting as a level. A value that takes a heading goes one heading level deeper per level, from `##` to `######`, so a schema that places one deeper is refused `heading-depth`, and a deeper plain string that holds a line break is refused `malformed-value` when it is written.
12
+ - One document is one thing, such as a task, a lead or an order: link others by `reference` rather than copying or nesting them, and keep a growing list of records as a folder of documents.
@@ -0,0 +1,12 @@
1
+ # Design an App
2
+
3
+ What an App's design settles before its code, one page per question House answers.
4
+
5
+ - [Which function does what](apps/design-functions): which part of House does each piece of the App's work, and what it costs.
6
+ - [Schemas that read well](apps/design-schema): how its types make documents that people and agents read.
7
+ - [Designs that load House](apps/design-load): what its saves, Triggers and functions cost, and the designs that cost less.
8
+ - [An App's look](apps/design-look): what House draws around its page, and what the App sets.
9
+
10
+ Keep a Room for the App where you write how it is developed: its decisions, its map and tickets, and what its Triggers and functions do. Name that Room in the App's README, so the next agent working on the App finds it. House reads nothing there.
11
+
12
+ [Example: tasks](apps/example-tasks) follows these pages.
@@ -2,7 +2,7 @@
2
2
 
3
3
  How a function hands each new lead to the manager on shift with the fewest leads since their shift began, records its decision and calls the CRM.
4
4
 
5
- A CRM posts each new lead to the Room's push address (`capture/push-addresses/create`) as `{"event": "lead.created", "card": {"id": 101}}`. The Room holds three types: `staff/<key>.md` with `manager_id`, the manager's id at the CRM; `shifts/<key>.md` with `staff`, the key, and `starts` and `ends` as ISO instants; and `decisions/<card>.md` with `card`, `staff` and `decided_at`. The App's `external_origins` lists the CRM's origin, the Room holds a Service key for it, and a Trigger runs the function for each lead:
5
+ A CRM posts each new lead to the Room's push address (`capture/push-addresses/create`) as `{"event": "lead.created", "card": {"id": 101}}`. Name where the CRM puts its event id as the address's `event_id`, when you create it or later with `capture/push-addresses/edit`, so a lead it sends again writes nothing; an address naming none takes a `webhook-id` header as the id. The Room holds three types: `staff/<key>.md` with `manager_id`, the manager's id at the CRM; `shifts/<key>.md` with `staff`, the key, and `starts` and `ends` as ISO instants; and `decisions/<card>.md` with `card`, `staff` and `decided_at`. The App's `external_origins` lists the CRM's origin, the Room holds a Service key for it, and a Trigger runs the function for each lead:
6
6
 
7
7
  ```json
8
8
  {
@@ -12,8 +12,8 @@ function taskCreation(draft: Draft) {
12
12
  : undefined;
13
13
  }
14
14
 
15
- function titleOf(draft: Draft): unknown {
16
- return draft?.parts.fields?.title?.value ?? taskCreation(draft)?.fields.title;
15
+ function nameOf(draft: Draft): unknown {
16
+ return draft?.parts.fields?.name?.value ?? taskCreation(draft)?.fields.name;
17
17
  }
18
18
 
19
19
  function el<K extends keyof HTMLElementTagNameMap>(
@@ -26,29 +26,29 @@ function el<K extends keyof HTMLElementTagNameMap>(
26
26
  return node;
27
27
  }
28
28
 
29
- function titleForm(
29
+ function nameForm(
30
30
  action: string,
31
31
  room: string,
32
32
  path: () => string,
33
33
  shown: unknown,
34
- parts: (title: string, held: Draft) => Parts,
35
- done: (title: HTMLInputElement) => void,
34
+ parts: (name: string, held: Draft) => Parts,
35
+ done: (name: HTMLInputElement) => void,
36
36
  ) {
37
37
  let held = drafts.current().find((draft) => draft.room === room && draft.path === path()) ?? null;
38
- const title = el('input', {
39
- value: String(titleOf(held) ?? shown),
38
+ const name = el('input', {
39
+ value: String(nameOf(held) ?? shown),
40
40
  required: true,
41
- ariaLabel: 'Title',
41
+ ariaLabel: 'Name',
42
42
  });
43
43
  const keep = () =>
44
44
  queued(async () => {
45
- const written = await write(room, path(), held, parts(title.value, held));
45
+ const written = await write(room, path(), held, parts(name.value, held));
46
46
  held = written.draft;
47
- if (written.stale) title.value = String(titleOf(held) ?? shown);
47
+ if (written.stale) name.value = String(nameOf(held) ?? shown);
48
48
  return written.stale;
49
49
  });
50
- title.oninput = () => void keep();
51
- const form = el('form', {}, title, el('button', {}, action));
50
+ name.oninput = () => void keep();
51
+ const form = el('form', {}, name, el('button', {}, action));
52
52
  form.onsubmit = async (event) => {
53
53
  event.preventDefault();
54
54
  const stale = await keep();
@@ -56,16 +56,16 @@ function titleForm(
56
56
  if (stale) return void (note.textContent = 'Not saved: stale.');
57
57
  if (!(await save(room, held))) return;
58
58
  held = null;
59
- done(title);
59
+ done(name);
60
60
  };
61
61
  return form;
62
62
  }
63
63
 
64
64
  function editForm(room: string, path: string, shown: unknown) {
65
- const parts = (title: string): Parts => ({
66
- fields: { title: { value: title, base: { value: shown } } },
65
+ const parts = (name: string): Parts => ({
66
+ fields: { name: { value: name, base: { value: shown } } },
67
67
  });
68
- return titleForm(
68
+ return nameForm(
69
69
  'Save',
70
70
  room,
71
71
  () => path,
@@ -76,22 +76,22 @@ function editForm(room: string, path: string, shown: unknown) {
76
76
  }
77
77
 
78
78
  function addForm(room: string) {
79
- const parts = (title: string, held: Draft): Parts => {
79
+ const parts = (name: string, held: Draft): Parts => {
80
80
  const kept = taskCreation(held) ?? { type: 'task', fields: { done: false }, sections: {} };
81
- return { creation: { ...kept, fields: { ...kept.fields, title } } };
81
+ return { creation: { ...kept, fields: { ...kept.fields, name } } };
82
82
  };
83
83
  const adding = drafts
84
84
  .current()
85
85
  .find((draft) => draft.room === room && draft.path.startsWith('tasks/') && taskCreation(draft));
86
86
  let path = adding?.path ?? `tasks/${crypto.randomUUID()}.md`;
87
- return titleForm(
87
+ return nameForm(
88
88
  'Add',
89
89
  room,
90
90
  () => path,
91
91
  '',
92
92
  parts,
93
- (title) => {
94
- title.value = '';
93
+ (name) => {
94
+ name.value = '';
95
95
  path = `tasks/${crypto.randomUUID()}.md`;
96
96
  },
97
97
  );
@@ -23,7 +23,7 @@ function draw(): void {
23
23
  note.textContent = '';
24
24
  if (room === undefined) main.replaceChildren('This App has no Room yet.');
25
25
  else if (open !== undefined)
26
- main.replaceChildren(editForm(open.room, open.path, open.fields!.title), note);
26
+ main.replaceChildren(editForm(open.room, open.path, open.fields!.name), note);
27
27
  else main.replaceChildren(list, addForm(room.locator), note);
28
28
  }
29
29
  if (!('pending' in answer)) shown();
@@ -35,7 +35,7 @@ function draw(): void {
35
35
  const done = task.fields!.done === true;
36
36
  const box = el('input', { type: 'checkbox', checked: done, ariaLabel: 'Done' });
37
37
  box.onchange = () => void queued(() => toggle(task.room, task.path, done));
38
- const link = el('a', { href: task.path }, String(task.fields!.title));
38
+ const link = el('a', { href: task.path }, String(task.fields!.name));
39
39
  link.onclick = (event) => {
40
40
  event.preventDefault();
41
41
  void bridge.push(`/${task.path}`);
@@ -2,14 +2,14 @@
2
2
 
3
3
  A whole tasks App over one Room, keeping every rule of the App pages; its `main.ts` goes on over two more pages.
4
4
 
5
- `schema.yaml`, also written into the Room's `settings/schema.yaml`:
5
+ `schema.yaml`, also written into the Room's `settings/schema.yaml`, so a task reads as its `# Buy milk` line over a `- [ ] Done` line:
6
6
 
7
7
  ```yaml
8
8
  task:
9
9
  properties:
10
- title: { type: string }
11
- done: { type: boolean }
12
- required: [title, done]
10
+ name: { type: string }
11
+ done: { type: boolean, title: Done }
12
+ required: [name, done]
13
13
  ```
14
14
 
15
15
  `app.json`, then `apps/bindings/set` with slot `tasks`:
@@ -34,8 +34,8 @@ const sync = await runtime.observe('sync-status');
34
34
  const drafts = await runtime.observe('room-drafts');
35
35
  const tasks = await runtime.observe('query', {
36
36
  pathPrefix: 'tasks',
37
- select: { fields: ['/title', '/done'] },
38
- orderBy: [{ by: { field: '/title' } }],
37
+ select: { fields: ['/name', '/done'] },
38
+ orderBy: [{ by: { field: '/name' } }],
39
39
  });
40
40
  const main = document.querySelector('main')!;
41
41
  const list = document.createElement('div');
@@ -0,0 +1,10 @@
1
+ # Times in an App function
2
+
3
+ How a function reads its Room's local time and turns a date and time there into a moment and back, with no time-zone library.
4
+
5
+ - **The event.** Beside `moment`, the UTC instant `Date` reads, the event carries the Room's `time_zone`, such as `Europe/Kyiv`, and the moment's `date` (`YYYY-MM-DD`) and `time` (`HH:MM:SS`) there, so the same day is the Room's day: `order.fields.delivery === event.date`.
6
+ - **To a moment.** `await house.toMoment({ date: '2026-11-10', time: '13:00' })` answers the ISO instant of a date and an `HH:MM` or `HH:MM:SS` time in the Room's zone, `'2026-11-10T11:00:00.000Z'` in Kyiv. At daylight saving, a time the clocks skip takes the moment just after the gap, `04:00` for `03:30` on the day Kyiv's clocks jump from `03:00` to `04:00`, and a time they repeat takes its earlier moment.
7
+ - **To the Room's time.** `await house.toLocal({ moment: event.moment })` answers the `time_zone`, `date` and `time` in the Room's zone of a date-time with its offset, written as a document's `date-time` field takes it.
8
+ - **Each is a call to House** that counts as no external call and rejects what it refuses with its `code`: `invalid-time` for what is no date and time, or no date-time with its offset, and `unknown-room` for a `room_ref` naming any Room but the run's own.
9
+
10
+ Next: [App functions](apps/functions)
@@ -2,12 +2,12 @@
2
2
 
3
3
  How an App declares a function that House runs on its servers when a Trigger fires, with no page open and no model.
4
4
 
5
- - **Declare.** `app.json` lists `functions`, each `{"name": "assign lead", "entry": "functions/assign.js"}` ([App manifest](reference/app-manifest)). The entry is one ES module whose default export is the function and which imports nothing, so your build bundles each function, with all it imports, into `dist/`, such as `esbuild src/assign.ts --bundle --format=esm --outfile=dist/functions/assign.js`. A publish is refused whole for an entry that is missing, imports, has no default export or is over <function-size>, for a name used twice, and for more than <release-functions> functions.
6
- - **Run.** A Trigger's `function` action names the App and one of its functions ([Triggers](reference/triggers)). House runs the App's latest release when the Event's turn comes, one Event of a Trigger after another, so a run reads what the run before it wrote. Runs share a fixed number of slots on House's servers, and a run waits, its action `waiting`, until one is free.
7
- - **The event.** `export default async (event, house) => {}` receives `kind`, the condition's `on`, with `room`, `trigger`, `id`, `moment` and what matched: `path` and `reference`, a document change's `transition`, an arriving item's `item` with its `headers` and raw `body` text, a dated document's `document`, a delivered notification's `notification`, the facts of its web document, or a message's `message`, its `sender` and its request's `agent_function`, never its words, with the document that request was started for as `path` and `reference`. `Date` reads `moment`. The return value is ignored, so write what you keep into the Room.
8
- - **The App API.** `house` is the page's App API over the Trigger's Room alone: `query(q)` ([Local Query](apps/local-query)), which reads only the documents of the `types`, folders (`folder`, `pathPrefix`) and `paths` it names and answers over them alone, so the rest of a large Room is never read: name the `types` or `pathPrefix` of its `hop` and `backlinks` too, and select its parts, since a query or `hop` or `backlinks` naming none, or selecting `backlinks` or `'all'`, is refused `invalid-query`, `saveParts(room, parts)`, `call(name, input)` for the Room acts, each by its House act name, such as `records/list` and `rooms/members/list`, and `callExternal(request)`. `query` and `callExternal` reject a refusal with its `code` for the function to catch, while `call` answers it as a result whose `kind` is `rejected` and `saveParts` as `outcome: 'refused'`, as on the page, so check what they answer. Its writes are the App's, by `App <App> (function <function>)`, fire Triggers, its own included, and count against the Room owner's Write limit.
9
- - **Reach.** A run holds no `fetch`, timer, file, `console` or `Intl`: keep times as ISO instants, or convert a local time by its UTC offset yourself. `callExternal` takes the request `bridge.callExternal` takes and is the one way out, to an origin the release's `external_origins` lists; naming its Room, `room_ref: event.room`, carries that Room's Service key, which the function never sees, or is refused `service_key_not_found` naming the `origin`. Its calls count against the Room owner's `external_calls` limit.
10
- - **Never repeated.** A run that started is never run again, even when it failed after a call reached the service. Send `event.id` as the service's idempotency key where it takes one, and name what you write by what the event carries, so a second delivery of the same thing finds it.
11
- - **Failure and limits.** A throw settles the run `failed` with `function_failed` and its text, which `triggers/fired/list` shows and the panel shows the Room's owner, with no notification; the next Event still runs. A run ends `failed` at <function-time>, at <function-memory> or past <function-calls> external calls: `time_cap_reached`, `memory_cap_reached` or `external_call_cap_reached`.
5
+ - **Declare.** `app.json` lists `functions`, each `{"name": "assign lead", "entry": "functions/assign.js"}` ([App manifest](reference/app-manifest)). The entry is one ES module that imports nothing and default-exports the function, so your build bundles each function with its imports into `dist/`, such as `esbuild src/assign.ts --bundle --format=esm --outfile=dist/functions/assign.js`. A publish is refused whole for an entry that is missing, imports, has no default export or is over <function-size>, for a name used twice, and for more than <release-functions> functions.
6
+ - **Run.** A Trigger's `function` action names the App and one of its functions ([Triggers](reference/triggers)). House runs the App's latest release when the Event's turn comes, one Event of a Trigger at a time, so a run reads what the one before wrote. Runs share a fixed number of slots on each server, one Room owner's at most <function-owner-slots>, and a run waits, its action `waiting`, until it may take one.
7
+ - **The event.** `export default async (event, house) => {}` receives `kind`, the condition's `on`, with `room`, `trigger`, `id`, `moment`, the Room's `time_zone`, `date` and `time` ([Times](apps/function-times)) and what matched: `path` and `reference`, a document change's `transition`, an arriving item's `item` with its `headers` and raw `body` text, a dated document's `document`, a delivered notification's `notification`, the facts of its web document, or a message's `message`, its `sender` and its request's `agent_function`, never its words, with the document that request was started for as `path` and `reference`. `Date` reads `moment`. The return value is ignored: write what you keep into the Room.
8
+ - **The App API.** `house` is the page's App API over the Trigger's Room alone: `query(q)` ([Local Query](apps/local-query)), which reads only the documents of the `types`, folders (`folder`, `pathPrefix`) and `paths` it names: name the `types` or `pathPrefix` of its `hop` and `backlinks` too and select its parts, since naming none, or selecting `backlinks` or `'all'`, is refused `invalid-query`, `saveParts(room, parts)`, `call(name, input)` for the Room acts by House act name and `callExternal(request)`. `call` answers a refusal as `kind: 'rejected'` and `saveParts` as `outcome: 'refused'`, as on the page; the others reject with its `code`. Its writes are the App's, by `App <App> (function <function>)`, fire Triggers, its own included, and count against the Room owner's Write limit.
9
+ - **Reach.** A run holds no `fetch`, timer, file, `console` or `Intl`: convert times by `house.toMoment` and `house.toLocal`, which a page lacks. `callExternal` takes the request `bridge.callExternal` takes and is the one way out; naming its Room, `room_ref: event.room`, carries that Room's Service key, which the function never sees; calls count against the Room owner's `external_calls` limit. Its webhook signing secret goes nowhere: `call('service-keys/signatures/check', { room_ref, origin, text, signature })` answers `matched`, whether `signature` is `text`'s HMAC-SHA256 under it, lowercase hex or base64. Both take only an origin the release's `external_origins` lists and are refused `not_found` naming the `origin` where the Room holds none.
10
+ - **Never repeated.** A run that started is never run again, even when it failed after a call reached the service. Send `event.id` as the service's idempotency key where it takes one, and name what you write by what the event carries, so a second delivery finds it.
11
+ - **Failure and limits.** A throw settles the run `failed` with `function_failed` and its text, which `triggers/fired/list` and the Room owner's panel show, with no notification; the next Event still runs. A run ends `failed` at <function-time>, at <function-memory> or past <function-calls> external calls: `time_cap_reached`, `memory_cap_reached` or `external_call_cap_reached`.
12
12
 
13
13
  Next: [Example: assign a lead](apps/example-function)
@@ -2,16 +2,16 @@
2
2
 
3
3
  How an App reads and writes its Rooms on the device, offline too.
4
4
 
5
- - The runtime holds every bound Room on the device and streams in every change from any device, App or agent. `query` and `observe` answer from the device and never wait on the network; `search` asks House ([Search rules](apps/search)).
5
+ - The runtime holds every bound Room on the device and streams in every change from any device, App or agent, but a Search-level Room, which an App shows only as the rows [`queryHouse`](apps/query-house) asks for, never offline. `query` and `observe` answer from the device and never wait on the network; `search` asks House ([Search rules](apps/search)).
6
6
  - Draw from `observe` at once, with no request of your own; an observation hears each later change by itself, so never poll, refetch or subscribe. An answer is `{ pending }` while a Room it reads has not reached this device or been prepared on it: draw the page without those documents; keep the empty state for a complete answer. `rooms` answers once the runtime knows the Rooms the page reaches. Offer binding a Room when it is empty while the sync status's `providerUnreachable` is false and `observe('connection-refusal')` answers `null`; any other empty list says only that nothing can be listed yet.
7
7
  - Show no loading state: draw the last state the device holds. A wait shows only after an act the User pressed whose answer comes from outside the stream, such as `bridge.callExternal`, until it arrives.
8
- - Write optimistically: write a Room Draft, then `save`. The change shows in every query at once as a Pending Change and reaches House when it can. `save` refuses at once, with its `code`, a change that is `stale`, `changed-underneath` or against the schema: say so and keep the form.
8
+ - Write optimistically: write a Room Draft, then `save`. The change shows in every query at once as a Pending Change and reaches House when it can. `save` refuses at once, with its `code`, a change that is `stale`, `changed-underneath` or against the schema: say so and keep the form. After `changed-underneath`, draw the joined Room Draft and its `marks` ([Room Drafts](apps/room-drafts)).
9
9
  - Show what the runtime reports: `observe('queue', room)` lists changes House has not confirmed yet, and `observe('sync-status')`'s `attentionRequired` lists each change House refused, returned as a Room Draft with why, to save again or discard.
10
- - Keep what the User types in the Room Draft (`roomDraft.write`) as they type; it survives a new release replacing the page, a reload and another tab. Draw a form again only when its page changes, never on a streamed change.
10
+ - Keep what the User types in the Room Draft (`roomDraft.write`) as they type; it survives a new release, a reload and another tab. Draw a form again only when its page changes, never on a streamed change.
11
11
  - A document has one Room Draft, shared by every tab and App, and `save` takes all of it. A write replaces every part and names the revision it read, so write onto the parts it holds; one from an older revision answers `stale` with the current Room Draft: show that one. A field part names as its `base` the value the page showed, `{ value }`, or `null` when the document has no such field.
12
12
  - Save a change the User does not type, such as a checkbox, with `saveParts(room, [{ path, parts }])`: it writes no Room Draft, so the one another tab holds stays.
13
13
  - Offline, all of this works and saves wait; `bridge.onStatus` reports `offline`: say so quietly.
14
- - A Room your User holds at the Open level locks once the browser has been offline 2 minutes, and from the moment it opens until House confirms the access. While it is locked, `rooms` lists it `locked: true`, a query that does not name it leaves it out, one naming it answers `{ pending }` with `awaits: 'unlock'`, and every other read and write naming it, `save` included, answers the code `room-locked` and keeps nothing. Draw it locked until it unlocks and keep what the User types in the page; what was saved before stays and is sent then.
15
- - An outside service is reached only at the origins `app.json` lists in `external_origins`, directly or through `bridge.callExternal`, sent by House's server. A call that names a Room bound to the App in a `write` slot with `room_ref` carries that Room's Service key for the origin, which the page never sees; any other call carries no key. A call through a Room that holds no key for the origin is refused `service_key_not_found` naming the `origin`: tell the person that the Room's owner or a manager enters the key under Service keys in the Room's Info, since no App opens that page.
14
+ - A Room your User holds at the Open level locks once the browser has been offline 2 minutes, and from the moment it opens until House confirms the access. While it is locked, `rooms` lists it `locked: true`, a query that does not name it leaves it out, one naming it answers `{ pending }` with `awaits: 'unlock'`, and every other read and write naming it, `save` included, answers the code `room-locked` and keeps nothing. Draw it locked until then and keep what the User types; what was saved before is sent then.
15
+ - An outside service is reached only at the origins `app.json` lists in `external_origins`, directly or through `bridge.callExternal`, sent by House's server. A call whose `room_ref` names a Room bound in a `write` slot carries that Room's Service key for the origin, unseen by the page; any other carries none. Through a Room holding no key for the origin it is refused `not_found` naming the `origin`: tell the person its owner or a manager enters the key under Connected in the Room's Settings, which no App opens.
16
16
  - The page's own storage is a disposable cache, the Room the only durable home of the App's data; handle any code or value you do not know by its `code` ([Refusals](apps/runtime-refusals)).
17
- - React: `useObserve` and `useSave` from `@agentshouse/mdruntime/react`. react-admin and Refine: the data providers of `@agentshouse/mdruntime-families`. The whole client: [The App runtime](apps/runtime).
17
+ - React: `useObserve` and `useSave` from `@agentshouse/mdruntime/react`. The whole client: [The App runtime](apps/runtime).
@@ -18,7 +18,7 @@ draw it as loading and observe the query to hear the complete answer. A query is
18
18
  the device alone: an App function refuses it.
19
19
  `text` keeps the Documents whose text contains that phrase, ignoring case, ranking
20
20
  nothing.
21
- - **Fields.** Every frontmatter value is named by JSON Pointer: `/status`,
21
+ - **Fields.** Every value of a typed Document is named by JSON Pointer: `/status`,
22
22
  `/shipping/city`, `~1` for a `/` and `~0` for a `~` in a key. A segment that meets a
23
23
  list applies to every item and a number names one item. `where` names pointers, ANDs
24
24
  them, and nests `$and` and `$or`; a pointer through a list holds if any item satisfies
@@ -30,7 +30,7 @@ draw it as loading and observe the query to hear the complete answer. A query is
30
30
  missing value is false and `$ne`, `$nin` and `$exists: false` true. A date
31
31
  compares in calendar order and never with a date-time. A date-time compares as an instant,
32
32
  whatever offset it is written in. A reference compares by the
33
- Room Path it resolves to. Untyped frontmatter, and a value under `oneOf` or a
33
+ Room Path it resolves to. An untyped Document's frontmatter, and a value under `oneOf` or a
34
34
  conditional, is plain values. There is no regular expression.
35
35
  - **Relations.** Within one Room, `hop: { field, types, where, pathPrefix }` keeps Documents
36
36
  whose reference at pointer `field`, at any depth, points to a matching Document, and
@@ -40,8 +40,8 @@ draw it as loading and observe the query to hear the complete answer. A query is
40
40
  `revision`, or `unreadable` where the App does not bind it or it is locked.
41
41
  - **Parts.** A Document query must `select`: `'all'`, or `fields`, `sections`,
42
42
  `preamble`, `markdown`, `backlinks`, `change`, `fileId`, `revision`, `size` and `created`, where `fields` is `'all'`
43
- or a list of pointers and `sections` `'all'` or a list of names. Selected pointers
44
- return the frontmatter holding only them, nested as written. A backlink names the
43
+ or a list of pointers and `sections` `'all'` or a list of names of sections whose heading
44
+ names no field. Selected pointers return the values holding only them, nested as written. A backlink names the
45
45
  referring Path, MD Type and the pointer it came from as `field`. Room and Path always
46
46
  return; a Markdown Document also returns its MD Type, and at most its first 1,000
47
47
  backlinks: a query on the referring field reads the rest. A non-Markdown Document
@@ -2,13 +2,13 @@
2
2
 
3
3
  What an App's page draws and how it behaves in the browser.
4
4
 
5
- - The App draws everything; House draws nothing around it. Set the tab's title with `bridge.setTab({ title })`.
6
- - The address bar is the shell's, not your page's: read your place from `bridge.address()` and `bridge.onAddress`, and move with `bridge.push` or `bridge.replace`, so Back, Forward, reload and a shared link keep it; a push to the address already shown replaces it, so a double click adds no history entry. After an act that ends what the page shows, and when a dialog closes, `bridge.replace` the next address; a replace with the address this page was opened from goes back to it, so Back returns to where the person came from. Keep the open item, tab, filter and search in the address. Addresses under `/render` and `/info` are House's.
5
+ - The App draws everything on its page; [An App's look](apps/design-look) says what House draws around it. Set the tab's title with `bridge.setTab({ title })`.
6
+ - The address bar is the shell's, not your page's: read your place from `bridge.address()` and `bridge.onAddress`, and move with `bridge.push` or `bridge.replace`, so Back, Forward, reload and a shared link keep it; a push to the address already shown replaces it, so a double click adds no history entry. After an act that ends what the page shows, and when a dialog closes, `bridge.replace` the next address; a replace with the address this page was opened from goes back to it, so Back returns to where the person came from. Keep the open item, tab, filter and search in the address. Addresses under `/render`, `/info` and `/home-screen` are House's.
7
7
  - Files: take one in with `binaryFile.attach` the moment it is chosen and keep the Path it answers, hand one out with `binaryFile.download`, and show an image or video in `<room-media>` naming its width and height, so nothing waits for media and nothing moves when it arrives; never read a file whole to show or download it ([files](apps/runtime-files)).
8
8
  - Mobile first: lay out from 360 pixels wide up, with no action behind hover alone.
9
- - Every control works from the keyboard and has a label; give it no focus style of your own and never remove the browser's focus mark.
9
+ - Every control works from the keyboard and has a label. Draw no focus mark: give nothing a focus style, and remove the browser's own ring with `* { outline: none; }`, the reset House's base carries, since that base does not reach your page. Nothing takes focus by itself: no `autofocus`, and no `focus()` that runs because a page or dialog opened.
10
10
  - An empty list says what it will hold and invites the first document.
11
11
  - Long names truncate with an ellipsis and show in full on hover.
12
12
  - The element is the link: a row, card or name opens its item; no "Open" buttons.
13
- - Offer installation yourself: `bridge.install()` from a click shows the browser's prompt, or answers `manual` where you show how.
13
+ - Offer installation yourself: `bridge.install()` from a click starts the install or shows the browser's prompt, or answers `manual` where you show how.
14
14
  - Offer a way out where your User expects one: `bridge.ceremony('/sign-out')` signs them out of House and opens sign-in.