@agentshouse/mdruntime 0.1.0-alpha.10 → 0.1.0-alpha.11

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 (2) hide show
  1. package/AGENTS.md +78 -0
  2. package/package.json +4 -3
package/AGENTS.md ADDED
@@ -0,0 +1,78 @@
1
+ # Instructions for the App Creator's agent
2
+
3
+ These instructions address an agent in an environment with Git. Obtain the
4
+ App Repository, change it, build, and push. They are documentation, not
5
+ enforcement.
6
+
7
+ ## The MD Runtime API
8
+
9
+ App code reaches the MD Runtime through the remote client. The surfaces are
10
+ Rooms, Query, Observe, Types, Draft, Save, Queue, History, Call, Log,
11
+ storage loss, the reported persistence answer, Sync Status, reauthorization,
12
+ conversation, the unsent instruction, and Presentation State.
13
+
14
+ Rooms, Query, Observe, Types, Draft, and Save never touch the network.
15
+ History and Call go to the Provider through the Adapter. Every member of the
16
+ client is asynchronous. Results are detached snapshots. Nothing in this
17
+ surface returns the authorization, performs a request the App's code
18
+ composes, or exposes the browser store.
19
+
20
+ The in-memory Adapter at `@agentshouse/mdruntime/memory` is for tests and
21
+ ships in no bundle.
22
+
23
+ ## Draft, Save, and outcome rules
24
+
25
+ A Draft is durable: it survives reload and navigation. Save takes structured
26
+ changes, validates locally, and on success appends one Change Batch to that
27
+ Room's queue. A local validation failure leaves the Draft and creates
28
+ nothing.
29
+
30
+ Outcomes follow the Provider's answer. Accepted advances the confirmed
31
+ layer. Conflicted and Rejected leave the head in place, carry the affected
32
+ current state and the Provider's structured refusal code and fields as
33
+ returned, and block that Room's queue. The App's code resolves a head by
34
+ discarding it or by saving a corrected Change Batch that replaces it in
35
+ place. Transport failure and Provider unavailability keep work Pending and
36
+ do not infer a rejection. A refusal the Provider marks retryable stays
37
+ Pending until the reset it names; the MD Runtime retries the same Change
38
+ Batch identity and payload and never infers an outcome from transport
39
+ uncertainty. The MD Runtime never combines, reorders, or rebases.
40
+
41
+ ## The neutrality rule
42
+
43
+ No module outside an Adapter package imports, names, or special-cases a
44
+ Provider. MD UI and every App reach data only through the client entry.
45
+
46
+ ## Content-safety rules
47
+
48
+ The Provider authorization belongs to the Runtime host and is never readable
49
+ by the App's code. The App's code reaches the network only at the external
50
+ origins its manifest declares, empty by default, and the Provider enforces
51
+ that set. Every request to the Provider itself goes through the MD Runtime.
52
+ Rendered Markdown never executes scripts, renders raw HTML only for the
53
+ details and summary elements, and loads images and other resources only from
54
+ origins the Provider's policy allows.
55
+
56
+ ## Launch promises MD UI keeps
57
+
58
+ MD UI uses semantic HTML, is fully operable from a keyboard with visible
59
+ focus and labelled controls, and lays out from a 360 pixel wide viewport to
60
+ a desktop. Its strings are English only, dates and numbers follow the
61
+ browser locale, and content is never translated. Light and dark themes come
62
+ from CSS custom properties with the browser's preference as the default and
63
+ an App's override respected. What an App Creator's agent adds carries none
64
+ of these promises by itself. Reading and querying never wait for the
65
+ network. Data lives only in the App Creator's browser and with the Provider.
66
+
67
+ ## App code imports only the client entry and never constructs a Runtime
68
+
69
+ App code imports only `@agentshouse/mdruntime/client` and calls
70
+ `connectMdRuntime` on the port the host hands it. It never constructs a
71
+ Runtime. It does not import the package main, the host entry, or the Adapter
72
+ package, and it does not call `createMdRuntime` or `serveMdRuntime`. Hosts
73
+ and tests use those entries; the served App does not.
74
+
75
+ ## What an agent must never do
76
+
77
+ An agent must never read the authorization, load code from a Room, call the
78
+ Provider directly, or rebase a refused Change Batch.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/mdruntime",
3
- "version": "0.1.0-alpha.10",
3
+ "version": "0.1.0-alpha.11",
4
4
  "description": "The headless core of MD App",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "files": [
34
34
  "dist",
35
+ "AGENTS.md",
35
36
  "LICENSE"
36
37
  ],
37
38
  "repository": {
@@ -44,7 +45,7 @@
44
45
  "url": "https://github.com/agentshouse/mdruntime/issues"
45
46
  },
46
47
  "dependencies": {
47
- "@agentshouse/mdmodel": "0.1.0-alpha.5",
48
- "@agentshouse/query": "0.1.0-alpha.3"
48
+ "@agentshouse/mdmodel": "0.1.0-alpha.7",
49
+ "@agentshouse/query": "0.1.0-alpha.5"
49
50
  }
50
51
  }