@agentshouse/skills 0.1.0-cdf317eaa8570 → 0.1.0-ce192f978a032

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 (54) hide show
  1. package/README.md +4 -4
  2. package/agent-instructions.json +4 -5
  3. package/dist/index.d.ts +1 -2
  4. package/dist/index.js +5 -12
  5. package/guide/{routines → agent-functions}/work-on-ticket.md +6 -8
  6. package/guide/apps/build.md +2 -1
  7. package/guide/apps/chat.md +32 -8
  8. package/guide/apps/client.md +1 -1
  9. package/guide/apps/content-safety.md +4 -4
  10. package/guide/apps/data.md +10 -6
  11. package/guide/apps/example-function.md +66 -0
  12. package/guide/apps/example-tasks-2.md +0 -2
  13. package/guide/apps/example-tasks.md +2 -34
  14. package/guide/apps/functions.md +13 -0
  15. package/guide/apps/local-first.md +10 -9
  16. package/guide/apps/local-query-results.md +13 -4
  17. package/guide/apps/local-query.md +20 -12
  18. package/guide/apps/page.md +3 -2
  19. package/guide/apps/room-drafts.md +21 -14
  20. package/guide/apps/runtime-api.md +17 -10
  21. package/guide/apps/runtime-conversations.md +28 -0
  22. package/guide/apps/runtime-files.md +8 -6
  23. package/guide/apps/runtime-refusals.md +10 -5
  24. package/guide/apps/runtime.md +1 -1
  25. package/guide/apps/search.md +21 -0
  26. package/guide/apps/start.md +5 -3
  27. package/guide/apps/verify.md +4 -5
  28. package/guide/index.md +5 -5
  29. package/guide/owner-rules.md +9 -8
  30. package/guide/reference/access-level.md +9 -0
  31. package/guide/reference/agent-function.md +15 -0
  32. package/guide/reference/app-manifest.md +1 -1
  33. package/guide/reference/schema.md +22 -11
  34. package/guide/reference/triggers.md +10 -4
  35. package/guide/sites/build.md +7 -6
  36. package/guide/sites/entry-data-contract.md +1 -1
  37. package/guide/sites/runtime.md +1 -1
  38. package/guide/skills/build-app.md +1 -1
  39. package/guide/skills/house-onboarding.md +8 -12
  40. package/guide/skills/prototype-app.md +6 -6
  41. package/guide/skills/wizard.md +7 -1
  42. package/owner-rules-earlier.json +5 -1
  43. package/package.json +1 -1
  44. package/set/code-review/SKILL.md +1 -1
  45. package/set/codebase-design/DESIGN-IT-TWICE.md +1 -1
  46. package/set/grilling/SKILL.md +1 -1
  47. package/set/implement-spec/SKILL.md +4 -2
  48. package/set/improve-codebase-architecture/SKILL.md +1 -1
  49. package/set/research/SKILL.md +1 -1
  50. package/set/wayfinder/SKILL.md +1 -1
  51. package/upstream.json +2 -2
  52. package/guide/apps/local-search.md +0 -35
  53. package/guide/reference/read-level.md +0 -9
  54. package/guide/reference/routine.md +0 -14
package/README.md CHANGED
@@ -11,7 +11,7 @@ The Skills agents.house serves its agents, and the texts its agents read.
11
11
  an App, `sites/` what a Site adds, and `skills/` agents.house's own Skills, `house-onboarding`,
12
12
  `prototype-app`, `build-app` and `wizard`, each page carrying the `name` and `description` a
13
13
  `SKILL.md` carries.
14
- `routines/` holds the Routines agents.house writes into every Private Room, frontmatter and
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
17
  - `agent-instructions.json` is the lines that open an agent's first prompt.
@@ -23,9 +23,9 @@ for (const { name } of listSkills()) console.log(name, readSkill(name).length);
23
23
  console.log(OWNER_RULES);
24
24
  ```
25
25
 
26
- `agentInstructions(houseRef, copies)` returns the first prompt's lines, `GUIDE` every Guide page
27
- with its path, title, first line and text, `WORK_ON_TICKET` the `routines/work-on-ticket` page's
28
- text and `EARLIER_OWNER_RULES_SHA256` the earlier texts' digests.
26
+ `agentInstructions()` returns the first prompt's lines, which name no Local copy,
27
+ `GUIDE` every Guide page with its path, title, first line and text and
28
+ `EARLIER_OWNER_RULES_SHA256` the earlier texts' digests.
29
29
 
30
30
  The skills come from [mattpocock/skills](https://github.com/mattpocock/skills); thank you, Matt
31
31
  Pocock.
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "lines": [
3
3
  "From House:",
4
- "Work with House through the `house` CLI: run `house --help`, and `house open_guide` 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 `house open_guide`. Never start a server.",
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
+ "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.",
6
6
  "Optional per-Room instructions: `/rooms/private/rooms/<handle>/AGENTS.md`.",
7
- "For another Agent's help, `send_routine_request`; its mail comes back into this conversation. If an Agent of your User has no Routine to call, write one in the Private Room and `create_routine_access` with your User as its only caller."
8
- ],
9
- "copies": "House Local copies; before work run `house fetch` and rebase onto `<house-ref>`; after it commit, then `house push`:"
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 Standing answers there allow; its mail comes back into this conversation."
8
+ ]
10
9
  }
package/dist/index.d.ts CHANGED
@@ -15,8 +15,7 @@ export interface GuidePage {
15
15
  export declare const GUIDE_ROOT = "index";
16
16
  export declare const GUIDE: readonly GuidePage[];
17
17
  export declare const OWNER_RULES: string;
18
- export declare const WORK_ON_TICKET: string;
19
18
  export declare const EARLIER_OWNER_RULES_SHA256: readonly string[];
20
- export declare function agentInstructions(houseRef: string, copies: readonly string[]): string[];
19
+ export declare function agentInstructions(): string[];
21
20
  export declare function listSkills(): readonly Skill[];
22
21
  export declare function readSkill(name: string): readonly SkillFile[];
package/dist/index.js CHANGED
@@ -4,20 +4,20 @@ import { fileURLToPath } from 'node:url';
4
4
  const PACKAGE = fileURLToPath(new URL('..', import.meta.url));
5
5
  const SET = join(PACKAGE, 'set');
6
6
  const ENTRY = 'SKILL.md';
7
- const REF_PLACEHOLDER = '<house-ref>';
8
7
  const TREE = join(PACKAGE, 'guide');
9
8
  const PAGE = '.md';
10
9
  const FRONTMATTER = /^---\n[\s\S]*?\n---\n\n?/u;
11
10
  const HEADING = /^# /u;
11
+ const LIST_ITEM = /^\s*[-*+] /u;
12
12
  export const GUIDE_ROOT = 'index';
13
13
  const OWNER_RULES_PAGE = 'owner-rules';
14
- const WORK_ON_TICKET_PAGE = 'routines/work-on-ticket';
15
14
  function packaged(name) {
16
15
  return readFileSync(join(PACKAGE, name), 'utf8');
17
16
  }
18
17
  function guidePage(file) {
19
18
  const text = readFileSync(join(TREE, file), 'utf8');
20
- 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)) ?? '';
21
21
  return {
22
22
  path: file.slice(0, -PAGE.length).split(sep).join('/'),
23
23
  title: heading.replace(HEADING, ''),
@@ -33,17 +33,10 @@ export const GUIDE = readdirSync(TREE, {
33
33
  .map((entry) => guidePage(relative(TREE, join(entry.parentPath, entry.name))))
34
34
  .sort((left, right) => (left.path < right.path ? -1 : 1));
35
35
  export const OWNER_RULES = GUIDE.find((page) => page.path === OWNER_RULES_PAGE).text;
36
- export const WORK_ON_TICKET = GUIDE.find((page) => page.path === WORK_ON_TICKET_PAGE).text;
37
36
  export const EARLIER_OWNER_RULES_SHA256 = JSON.parse(packaged('owner-rules-earlier.json'));
38
37
  const INSTRUCTIONS = JSON.parse(packaged('agent-instructions.json'));
39
- export function agentInstructions(houseRef, copies) {
40
- if (copies.length === 0)
41
- return [...INSTRUCTIONS.lines];
42
- return [
43
- ...INSTRUCTIONS.lines,
44
- INSTRUCTIONS.copies.replaceAll(REF_PLACEHOLDER, houseRef),
45
- ...copies,
46
- ];
38
+ export function agentInstructions() {
39
+ return [...INSTRUCTIONS.lines];
47
40
  }
48
41
  export function listSkills() {
49
42
  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
 
8
- The Routine an Agent runs when a person sets a Wayfinding ticket in progress with that Agent as its assignee.
3
+ - **Description**: Work the Wayfinding ticket this request names, from its Question to its Answer.
4
+ - **Input**: The ticket to work on.
5
+
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 this conversation.
10
+ 1. Open the `wayfinding-ticket` the request names and set its `conversation` to the id of this conversation, which House's first message names.
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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  How to build an App over your User's Rooms and publish it, one page per step.
4
4
 
5
- An App is a web page over your User's Rooms, for your User and whom they share it with (`create_share`). 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.
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
7
  - [Start an App](apps/start)
8
8
  - [An App's data](apps/data)
@@ -11,3 +11,4 @@ An App is a web page over your User's Rooms, for your User and whom they share i
11
11
  - [An App's page](apps/page)
12
12
  - [Verify an App](apps/verify)
13
13
  - [The App runtime](apps/runtime)
14
+ - [App functions](apps/functions)
@@ -8,16 +8,40 @@ 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, the list beside the chat on a
13
+ wider one once the User shows it or the element passes 1000 px, and the chat's details beside
14
+ both on a wide one. With no chat open it shows what
15
+ asks the User and what works now. `conversation` opens one chat, and with it `null` the Chat
16
+ opens a new chat with `agent`, the Agent it goes to, or the list with neither. `onOpen` hears
17
+ each chat it opens as `{ conversation, agent }`, and both `null` when the User goes back to the
18
+ list, and `onLink` takes a link without a scheme in place of the browser.
19
+ Or mount it as the Chat button, which takes no element:
20
+ `const button = await houseBridge.chat.mountButton(options)` draws House's dot at the
21
+ window's bottom-right corner, which counts what asks the User or, while nothing does, the chats
22
+ that replied since the User opened them, and breathes while a turn runs; pressing it opens the
23
+ Chat in a sheet above the page, and pressing it again hides it. The dot stays in view over the
24
+ sheet, which the User moves, resizes up to the window's edges and lets fill the window, and the
25
+ page under it never changes, so leave nothing of the page to make room for it.
26
+ `button.open(target)` opens the sheet, on `{ conversation }` or on a new chat with
27
+ `{ agent }`, or as it was with no target, and with `docked: true` docked at full height along
28
+ the window's right edge; `button.hide()` hides it, keeping its chat, scroll and typed text;
29
+ `button.update(options)` and `button.unmount()` work as for a page, with `onOpen` and
30
+ `onLink`. To open on text written in, write it as the chat's draft through the runtime's
31
+ `chatDraft` first, keyed `new:<agent>` for a new chat. In the sheet the input's + holds This
32
+ page, which attaches the page's Page metadata to one message: a new chat's first message starts
33
+ with it ticked. Mount one button per page.
34
+ In either form the Chat draws inside its own shadow root, so no rule of the App's stylesheet
35
+ reaches it. `chat.mount` needs an element that can hold a shadow root, such as a `div` or a
36
+ `section`, and rejects on a `li`, a `td` or a `form`.
16
37
  Theme its own styles with CSS custom properties on the element or an ancestor:
17
38
  `--chat-background`, `--chat-surface`, `--chat-text`, `--chat-text-muted`,
18
39
  `--chat-accent`, `--chat-line`, `--chat-attention`, `--chat-danger`, `--chat-font`,
19
40
  `--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
41
+ spacing); an unset one keeps House's light or dark look. For the Chat button, which takes no
42
+ element, set them on the document's root element. Its dot is House's and takes none of them.
43
+ It shows conversations only where the release declares them;
44
+ otherwise it lists no conversation and no Agent. A secret
22
45
  question is never answered here; typed answers live in the Presentation State members named
23
- `typed:…`: leave them.
46
+ `typed:…`, whether the list shows in `chat:page-list`, and the sheet's size, place, list and
47
+ open chat in `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,9 +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 visible focus and
14
- labelled controls, and lays out from a 360 pixel wide viewport to a desktop. Its strings
15
- are English only, dates and numbers follow the browser locale, and content is never
16
- translated. Light and dark themes come from CSS custom properties, defaulting to the
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.
15
+ Its strings are English only, dates and numbers follow the browser locale, and content is
16
+ never translated. Light and dark themes come from CSS custom properties, defaulting to the
17
17
  browser's preference and respecting an App's override. What an agent adds carries none of
18
18
  these promises by itself. Data lives only in the App Creator's browser and the Provider.
@@ -2,10 +2,14 @@
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
- - `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 `set_app_bindings`; 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
- - A bound Room must hold each slot type identically in its own `settings/schema.yaml`, beside any other types, or your User is warned. Write it with `edit` before binding; `create_room` makes a new Room.
10
- - Read an existing Room's `settings/schema.yaml` before inventing types. Two Apps over one schema are two interfaces over the same data, and your User's Agents read and write those documents too.
11
- - What no browser can do, such as acting when documents change or at a set time, is a Trigger (`create_trigger`) that notifies or starts a Routine on an Agent; what it writes reaches the App at once.
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
+ - 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.
10
+ - A slot may hold a Space instead (`apps/bindings/set` with `space_ref`): every Room of it your User holds, now and later. An App its owner puts into a Space (`apps/space/set`) uses that Space's schema instead of its own `schema.yaml`, and every member of the Space uses it, each slot holding the Space's Rooms.
11
+ - Read an existing Room's `settings/schema.yaml` before inventing types. Two Apps over one schema are two interfaces over the same data, and your User's agents read and write those documents too.
12
+ - House's own facts, such as your User's Rooms and the Space each is in, come from House acts: name each in `app.json` `house_acts` and call it with `runtime.call('<act>', input)`, such as `runtime.call('rooms/list', {})`. A call needs a connection, so offline show what the bound Rooms hold. A slot holding the Private Room brings its Triggers and none of the other documents House writes under its `house/`.
13
+ - `shares/create` lets a person into Rooms and Apps: its answer's `added` is `true` when their _Who can add me_ setting admits your User, so they are in at once, and `false` when the Share waits for their Accept.
14
+ - What no browser can do, such as acting when documents change or at a set time, is a Trigger (`triggers/create`) that notifies or runs one of the App's [functions](apps/functions) on House's servers; what it writes reaches the App at once.
15
+ - A Trigger may also start an [Agent function](reference/agent-function) on an Agent of your User.
@@ -0,0 +1,66 @@
1
+ # Example: assign a lead
2
+
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
+
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
+
7
+ ```json
8
+ {
9
+ "on": "items",
10
+ "query": { "where": { "/address": "<push address>", "/json/event": "lead.created" } }
11
+ }
12
+ ```
13
+
14
+ ```js
15
+ export default async (event, house) => {
16
+ const lead = JSON.parse(event.item.body);
17
+ const now = event.moment;
18
+ const card = lead.card.id;
19
+ const read = async (query) => house.query({ select: { fields: 'all' }, ...query });
20
+ const [held] = (await read({ types: ['decision'], paths: [`decisions/${card}.md`] })).documents;
21
+ if (held !== undefined) return;
22
+ const { documents: shifts } = await read({
23
+ types: ['shift'],
24
+ where: { '/starts': { $lte: now }, '/ends': { $gt: now } },
25
+ });
26
+ if (shifts.length === 0) throw new Error('no manager is on shift');
27
+ const leads = async (shift) =>
28
+ (
29
+ await read({
30
+ types: ['decision'],
31
+ where: { '/staff': shift.fields.staff, '/decided_at': { $gte: shift.fields.starts } },
32
+ limit: 1,
33
+ total: true,
34
+ })
35
+ ).total;
36
+ const counted = await Promise.all(
37
+ shifts.map(async (shift) => ({ shift, leads: await leads(shift) })),
38
+ );
39
+ const [{ shift: chosen }] = counted.sort((left, right) => left.leads - right.leads);
40
+ const [manager] = (await read({ types: ['staff'], paths: [`staff/${chosen.fields.staff}.md`] }))
41
+ .documents;
42
+ const answer = await house.callExternal({
43
+ url: `https://crm.example/cards/${card}`,
44
+ method: 'PUT',
45
+ headers: { 'content-type': 'application/json', 'idempotency-key': event.id },
46
+ body: JSON.stringify({ status: 'assigned', manager: manager.fields.manager_id }),
47
+ room_ref: event.room,
48
+ });
49
+ if (answer.status !== 200) throw new Error(`the CRM answered ${answer.status}: ${answer.body}`);
50
+ const saved = await house.saveParts(event.room, [
51
+ {
52
+ path: `decisions/${card}.md`,
53
+ parts: {
54
+ creation: {
55
+ type: 'decision',
56
+ fields: { card, staff: chosen.fields.staff, decided_at: now },
57
+ sections: {},
58
+ },
59
+ },
60
+ },
61
+ ]);
62
+ if (saved.outcome !== 'saved') throw new Error(JSON.stringify(saved));
63
+ };
64
+ ```
65
+
66
+ A lead the CRM delivers again finds its decision and calls nothing. Two leads that arrive together run one after another, so the second counts the first's decision and goes to another manager when two are tied. Each count is a query's `total`, so a long shift is never cut at a page. A failed call fails the run with the CRM's answer; the next lead still runs.
@@ -42,9 +42,7 @@ function titleForm(
42
42
  });
43
43
  const keep = () =>
44
44
  queued(async () => {
45
- unsaved.add(title);
46
45
  const written = await write(room, path(), held, parts(title.value, held));
47
- unsaved.delete(title);
48
46
  held = written.draft;
49
47
  if (written.stale) title.value = String(titleOf(held) ?? shown);
50
48
  return written.stale;
@@ -12,7 +12,7 @@ task:
12
12
  required: [title, done]
13
13
  ```
14
14
 
15
- `app.json`, then `set_app_bindings` with slot `tasks`:
15
+ `app.json`, then `apps/bindings/set` with slot `tasks`:
16
16
 
17
17
  ```json
18
18
  { "entry": "index.html", "room_slots": [{ "name": "tasks", "access": "write", "types": ["task"] }] }
@@ -23,43 +23,11 @@ task:
23
23
  ```ts
24
24
  import { houseBridge } from '@agentshouse/app-bridge';
25
25
 
26
- type Task = { top: number; field: string | null; start: number | null; end: number | null };
27
-
28
26
  const bridge = houseBridge();
29
27
  let shown!: () => void;
30
28
  const showing = new Promise<void>((resolve) => (shown = resolve));
31
29
  let writing: Promise<unknown> = Promise.resolve();
32
- const unsaved = new Set<HTMLInputElement>();
33
- bridge.cooperate({
34
- checkpoint: () => showing,
35
- async persist() {
36
- await writing;
37
- if ([...unsaved].some((title) => title.isConnected)) throw new Error('unsaved');
38
- },
39
- capture(): Task {
40
- const at = document.activeElement;
41
- const field = at instanceof HTMLInputElement && at.selectionStart !== null ? at : null;
42
- return {
43
- top: scrollY,
44
- field: field?.ariaLabel ?? null,
45
- start: field?.selectionStart ?? null,
46
- end: field?.selectionEnd ?? null,
47
- };
48
- },
49
- async restore(task) {
50
- await showing;
51
- const held = task as Task | null;
52
- if (held === null) return;
53
- const field = Array.from(document.querySelectorAll('input')).find(
54
- (input) => held.field !== null && input.ariaLabel === held.field,
55
- );
56
- field?.focus({ preventScroll: true });
57
- field?.setSelectionRange(held.start, held.end);
58
- scrollTo(0, held.top);
59
- },
60
- ready: () => true,
61
- settle() {},
62
- });
30
+ bridge.cooperate({ placed: () => showing });
63
31
  const runtime = await bridge.runtime;
64
32
  const rooms = await runtime.observe('rooms');
65
33
  const sync = await runtime.observe('sync-status');
@@ -0,0 +1,13 @@
1
+ # App functions
2
+
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
+
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 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` 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 `rooms/members/list` and `triggers/fired/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 `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`.
12
+
13
+ Next: [Example: assign a lead](apps/example-function)
@@ -1,16 +1,17 @@
1
1
  # Local first
2
2
 
3
- How an App reads and writes its Rooms on the device, offline included.
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`, `search` and `observe` answer from the device and never wait on the network.
6
- - Draw from `observe` at once, with no loading spinner for Room data and no request of your own; an observation hears each later change by itself, so never poll, refetch or subscribe to House. An answer is `{ pending }` while a Room it reads has not reached this device or been prepared on it, or the search index has not: draw the page without those documents, and keep the empty state for a complete answer that has none. `rooms` answers once the runtime knows the Rooms the page reaches. Offer binding a Room when it is empty while the sync status names House reachable (`providerUnreachable` false) and `observe('connection-refusal')` answers `null`; an empty list at any other moment says only that nothing can be listed yet.
7
- - 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.
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)).
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
+ - 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. After `changed-underneath`, draw the joined Room Draft and its `marks` ([Room Drafts](apps/room-drafts)).
8
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.
9
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
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.
11
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.
12
- - Offline, all of this works and saves wait. `bridge.onStatus` reports `offline`; say so quietly.
13
- - A Room your User reads by Online Read 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 or search 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 as locked until it unlocks and keep what the User types in the page; what was saved before stays and is sent then.
14
- - An outside service is reached only at the origins `app.json` lists in `external_origins`, directly or through `bridge.callExternal`, which House's server sends; neither carries a key.
15
- - 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 through `code` and `retryable`, which every refusal and failure carries.
16
- - React: `useObserve` and `useSave` from `@agentshouse/mdruntime/react`. react-admin and Refine: the data providers of `@agentshouse/mdruntime-families`. The whole client is described in [The App runtime](apps/runtime).
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 `not_found` naming the `origin`: tell the person that the Room's owner or a manager enters the key under Connected on the Room's Settings page, since no App opens that page.
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`. The whole client: [The App runtime](apps/runtime).
@@ -11,11 +11,20 @@ How a Local Query answers each change, orders, groups and pages its result, and
11
11
  one Path for another is the same file moved, and an unsent creation has neither until it
12
12
  is Accepted. `revision` is the Provider's head revision, `null` for an unsent creation or edit,
13
13
  and moves with an unsent move. A Room's last change is its Document with the latest `time`.
14
- - **Order and groups.** `orderBy` sorts by `room`, `path`, `type`, `folder` or `{ field }`: missing
15
- and null first, last with `nulls: 'last'`, then numbers and booleans, then text by `locale` or
14
+ - **Size and Created.** `size` is the bytes a row holds, a text's UTF-8 length or a file's
15
+ `byteLength`, and `created` the ISO 8601 time its file was created, or `null` where the
16
+ Provider names none; an unsent creation takes the time it was saved.
17
+ - **Order and groups.** `orderBy` sorts by `room`, `path`, `type`, `folder`, `size`, `created`,
18
+ `updated`, which is its change's `time`, or `{ field }`: missing
19
+ and null first, last with `nulls: 'last'`, then numbers and booleans, then date-times as instants, then text by `locale` or
16
20
  code point with `stringSort: 'lexical'`, then lists item by item; ties end with Room, then Path.
17
- `groupBy` by `room`, `type`, `folder` or `{ field }` answers `{ groups: [{ key, count }] }`,
18
- counted over every match and ordered by `count` or a key. A sort or group takes only a
21
+ `groupBy` by `room`, `type`, `folder`, `subfolder` or `{ field }` answers `{ groups: [{ key, count }] }`,
22
+ counted over every match. `subfolder` is the child folder of `pathPrefix`, or of the Room's root,
23
+ that holds a row, `null` for a row directly in it, so one query totals every child folder. A
24
+ group's `select: { size: true }` adds `documents` and `files`, each `{ count, size }`,
25
+ `updated: true` its latest `updated`, and `greatest: { field }` that field's greatest value. A
26
+ group orders by `count`, `size`, `updated`, `greatest` or a key, each with `nulls`. Grouped by
27
+ `folder` or `subfolder` alone, a folder holding no match answers a count of 0. A sort or group takes only a
19
28
  single-value pointer. `limit`, at most 1,000 whatever a query names, bounds the Documents or the
20
29
  groups, and a result it cuts short names `next`: the same query with it as `after` reads the next
21
30
  window, in the same order, ties included. `total: true` adds `total`, every match's count. An
@@ -11,19 +11,27 @@ draw it as loading and observe the query to hear the complete answer. A query is
11
11
 
12
12
  - **Filter.** `rooms` names Room locators and defaults to every Room. `types` names MD
13
13
  Types, and `any` names untyped Markdown Documents. `pathPrefix` is a directory: `notes`
14
- keeps `notes/a.md` and not `notes2/a.md`; `folder` keeps only what lies directly in it.
14
+ keeps `notes/a.md` and not `notes2/a.md`; `outside` names directories whose contents stay
15
+ out, `['house']` leaving `house/` out; `folder` keeps only what lies directly in it.
15
16
  `paths` keeps only the Paths it names: read named Documents so, never from a list.
16
- - **Fields.** Every frontmatter value is named by JSON Pointer: `/status`,
17
+ `fileIds` keeps only the Documents of the `fileId`s it names, wherever they moved, on
18
+ the device alone: an App function refuses it.
19
+ `text` keeps the Documents whose text contains that phrase, ignoring case, ranking
20
+ nothing.
21
+ - **Fields.** Every value of a typed Document is named by JSON Pointer: `/status`,
17
22
  `/shipping/city`, `~1` for a `/` and `~0` for a `~` in a key. A segment that meets a
18
23
  list applies to every item and a number names one item. `where` names pointers, ANDs
19
24
  them, and nests `$and` and `$or`; a pointer through a list holds if any item satisfies
20
25
  it. A bare value is equality; the operators are `$eq`, `$ne`, `$in`, `$nin`, `$gt`,
21
- `$gte`, `$lt`, `$lte`, `$all`, `$size` and `$exists`. Equality on a list asks if it
26
+ `$gte`, `$lt`, `$lte`, `$all`, `$size`, `$exists` and `$prefix`, which keeps text starting
27
+ with it, case kept. Equality on a list asks if it
22
28
  contains the value. Missing, null and empty differ: `$exists: false` keeps a missing
23
- field, `null` an explicit null, `''` empty text and `$size: 0` an empty list. A date
24
- compares in calendar order and never with a date-time. A reference compares by the
25
- Room Path it resolves to. Untyped frontmatter, and a value under `oneOf` or a
26
- conditional, is plain values. There is no text containment or regular expression.
29
+ field, `null` an explicit null, `''` empty text and `$size: 0` an empty list. A test on a
30
+ missing value is false and `$ne`, `$nin` and `$exists: false` true. A date
31
+ compares in calendar order and never with a date-time. A date-time compares as an instant,
32
+ whatever offset it is written in. A reference compares by the
33
+ Room Path it resolves to. An untyped Document's frontmatter, and a value under `oneOf` or a
34
+ conditional, is plain values. There is no regular expression.
27
35
  - **Relations.** Within one Room, `hop: { field, types, where, pathPrefix }` keeps Documents
28
36
  whose reference at pointer `field`, at any depth, points to a matching Document, and
29
37
  `backlinks` with the same keys those a matching Document references, each once. A body
@@ -31,14 +39,14 @@ draw it as loading and observe the query to hear the complete answer. A query is
31
39
  `resolve(room, path, destination)` answers its `document`, the `deleted` one's last
32
40
  `revision`, or `unreadable` where the App does not bind it or it is locked.
33
41
  - **Parts.** A Document query must `select`: `'all'`, or `fields`, `sections`,
34
- `preamble`, `markdown`, `backlinks`, `change`, `fileId` and `revision`, where `fields` is `'all'`
35
- or a list of pointers and `sections` `'all'` or a list of names. Selected pointers
36
- return the frontmatter holding only them, nested as written. A backlink names the
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 of sections whose heading
44
+ names no field. Selected pointers return the values holding only them, nested as written. A backlink names the
37
45
  referring Path, MD Type and the pointer it came from as `field`. Room and Path always
38
46
  return; a Markdown Document also returns its MD Type, and at most its first 1,000
39
47
  backlinks: a query on the referring field reads the rest. A non-Markdown Document
40
- returns only Room, Path and a selected `fileId` and `revision`, a binary Path entry its `binaryFile`
41
- record too, and a text file its text as a selected `markdown`, kept out of Search. An unselected part is absent. Select only what a screen shows: a list
48
+ returns only Room, Path and a selected `change`, `fileId`, `revision`, `size` and `created`, a binary Path entry its `binaryFile`
49
+ record too, and a text file its text as a selected `markdown`. An unselected part is absent. Select only what a screen shows: a list
42
50
  that selects the Markdown hears every edit of it.
43
51
 
44
52
  Next: [Local Query changes, order and results](apps/local-query-results)
@@ -3,11 +3,12 @@
3
3
  What an App's page draws and how it behaves in the browser.
4
4
 
5
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`, `/info` and `/tab-icon` are House's.
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.
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, with visible focus and a label.
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.
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
13
  - Offer installation yourself: `bridge.install()` from a click shows the browser's prompt, or answers `manual` where you show how.
14
+ - Offer a way out where your User expects one: `bridge.ceremony('/sign-out')` signs them out of House and opens sign-in.
@@ -5,7 +5,8 @@ How App code writes a Room Draft, saves it and learns what became of each change
5
5
  The MD Runtime owns one durable Room Draft per Room and Path, shared by every App and tab
6
6
  across reloads; a Room the Provider reports lost takes its Room Drafts and queue with it.
7
7
  Write one with `roomDraft.write(room, path, revision, parts)`, naming the revision you read
8
- or `null`, and every part it now changes: fields, sections and the preamble, or the whole
8
+ or `null`, and every part it now changes: fields, long text and lists included, sections
9
+ whose heading names no field and the preamble, or the whole
9
10
  Markdown, a creation, a move, into another Room when it names `room`, or a removal. A new
10
11
  part names its base, the value you showed when it was opened, a field's as `{ value }` or
11
12
  `null` for no such field, and keeps its first base; a binary Path entry's move or removal
@@ -14,21 +15,27 @@ current Room Draft.
14
15
 
15
16
  Save takes one Room and the Room Drafts of it to save, each with its revision, validates
16
17
  locally, and on success appends one Change Batch to that Room's queue and removes those Room
17
- Drafts. Refused as `stale`, `changed-underneath` naming each part whose base no longer
18
- matches the visible state, or a local validation rule, it creates nothing and leaves every
19
- Room Draft. A directory move or removal is that part on each Document and binary Path entry
20
- beneath it, saved together; moves into another Room, saved alone, are one Change Batch in
21
- both Rooms' queues. `saveParts(room, [{ path, parts }])` saves parts, each Path once and
22
- each new part with its base, the same way but writes no Room Draft: one held at a saved Path
23
- stays, one at a moved Path moves with it to a destination that holds none. Never save by
24
- writing back a Room Draft read before.
18
+ Drafts. Refused as `stale`, `changed-underneath` naming each part changed underneath, or a
19
+ local validation rule, it creates nothing and removes no Room Draft. On `changed-underneath`
20
+ it first joins each one over the current Document under a new revision: show that one. A
21
+ field, a move, a removal and a replaced file keep yours; a section, the preamble, and a
22
+ whole Markdown whose sections do not match hold the current text, then yours; a whole
23
+ Markdown otherwise joins section by section. `marks`, keyed like `parts`,
24
+ names each part holding both sides with the `change`, `{ author, time }` or `null`, that
25
+ saved the current side, and a field's or file's `current`. Offer only Save and Discard; a
26
+ write keeps the marks of the parts it still names. A directory move or removal is that part
27
+ on each Document and binary Path entry beneath it, saved together; moves into another Room,
28
+ saved alone, are one Change Batch in both Rooms' queues. `saveParts(room, [{ path, parts
29
+ }])` saves parts, each Path once and each new part with its base, the same way but writes no
30
+ Room Draft: one held at a saved Path stays, one at a moved Path moves with it to a
31
+ destination that holds none. Never save by writing back a Room Draft read before.
25
32
 
26
33
  Outcomes follow the Provider's answer. An Accepted Change Batch stays in the queue, drawn
27
34
  over the confirmed layer, until that layer reaches the Room Version it was accepted at.
28
- Conflicted and Rejected, an expired operation, and a change that no longer applies each
29
- leave the queue and return as Room Drafts on their Documents, marked with why: the
30
- Provider's structured refusal code and fields as returned, not known to have applied, or
31
- withdrawn locally. The rest of the queue keeps synchronizing, and Sync Status requires
35
+ Conflicted and Rejected, and a change that no longer applies, each
36
+ leave the queue and return as Room Drafts on their Documents, joined as above and marked
37
+ with why: the Provider's structured refusal code and fields as returned, not known to have
38
+ applied, or withdrawn locally. The rest of the queue keeps synchronizing, and Sync Status requires
32
39
  attention until each returned Room Draft is saved or discarded. `observe('queue', room)`
33
40
  shows each Pending Change Batch, which keeps no outcome once it leaves. Transport failure,
34
41
  Provider unavailability and a refusal marked retryable, until the reset it names, keep
@@ -42,4 +49,4 @@ read-only instead of retrying. `observe('readiness')` tells whether code and bou
42
49
  locally (`ready`), each Room's state, each refused Room's file and rule, the persistence answer, `space`
43
50
  (`full` once the device's storage refused a write, Save and messages refusing as `durable-write` until
44
51
  `retry()` or a later test write finds space, or once the origin refused a newer release), and the
45
- `installation`'s Rooms, parts, bytes, `received`, `step` and `paused`.
52
+ `installation`'s Rooms, parts, bytes, `step` and `paused`.