@abide/abide 0.123.3 → 0.124.1
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.
- package/ABIDE.md +8 -5
- package/CHANGELOG.md +38 -0
- package/docs/REGISTRY.md +45 -12
- package/docs/RULEBOOK.md +29 -16
- package/docs/abide.md +999 -459
- package/package.json +1 -1
- package/src/compiler/ARRAY_MUTATORS.ts +20 -0
- package/src/compiler/LoweredFile.ts +609 -0
- package/src/compiler/Lowering.ts +46 -4
- package/src/compiler/SHARED_NAMES.ts +2 -0
- package/src/compiler/ShadowHost.ts +670 -0
- package/src/compiler/ShadowMap.ts +1 -1
- package/src/compiler/TypeSession.ts +71 -1715
- package/src/compiler/appLints.ts +109 -0
- package/src/compiler/checkedShadow.ts +1 -1
- package/src/compiler/classifyRead.ts +16 -1
- package/src/compiler/compileApp.ts +2 -2
- package/src/compiler/declaredExports.ts +44 -17
- package/src/compiler/diagnoseSources.ts +232 -0
- package/src/compiler/formatAbide.ts +5 -6
- package/src/compiler/handlersUnder.ts +16 -35
- package/src/compiler/projectShadow.ts +1 -0
- package/src/compiler/reactiveReads.ts +235 -0
- package/src/compiler/reactiveTypes.ts +13 -0
- package/src/compiler/readsIn.ts +180 -81
- package/src/compiler/routesDeclaration.ts +46 -0
- package/src/compiler/scaffold.ts +7 -2
- package/src/compiler/serveLanguage.ts +26 -20
- package/src/compiler/splitImports.ts +2 -2
- package/src/server/BRIDGE_VERSION.ts +1 -1
- package/src/server/DesktopSession.ts +213 -0
- package/src/server/Followers.ts +399 -0
- package/src/server/MODULE_QUERIES.ts +6 -2
- package/src/server/PageRender.ts +201 -0
- package/src/server/abideModules.ts +7 -7
- package/src/server/answerFailure.ts +3 -2
- package/src/server/answerRequest.ts +6 -70
- package/src/server/answerRpc.ts +48 -260
- package/src/server/answerSocket.ts +41 -463
- package/src/server/appKit.ts +1 -1
- package/src/server/argsContract.ts +1 -1
- package/src/server/createApp.ts +8 -2
- package/src/server/csp.ts +1 -1
- package/src/server/deferredBuilds.ts +3 -16
- package/src/server/faceOf.ts +1 -1
- package/src/server/generatedSurfaces.ts +2 -1
- package/src/server/handlerFileMount.ts +1 -1
- package/src/server/index.ts +1 -1
- package/src/server/installServer.ts +5 -9
- package/src/server/invokeHandler.ts +230 -0
- package/src/server/mountHandlers.ts +184 -0
- package/src/server/openDesktopWindow.ts +308 -0
- package/src/server/preload.ts +18 -0
- package/src/server/principal.ts +1 -1
- package/src/server/remote.ts +1 -1
- package/src/server/render.ts +31 -59
- package/src/server/requestScope.ts +5 -36
- package/src/server/runDesktop.ts +19 -447
- package/src/server/seedBuffer.ts +11 -11
- package/src/server/servedApp.ts +1 -1
- package/src/server/shell.ts +1 -1
- package/src/server/surfaceOf.ts +1 -1
- package/src/server/versionOf.ts +1 -1
- package/src/shared/RPC_SERVER.ts +27 -31
- package/src/shared/Schema.ts +1 -2
- package/src/shared/index.ts +1 -1
- package/src/shared/{note.ts → issueReport.ts} +22 -0
- package/src/shared/loadCall.ts +66 -0
- package/src/shared/reactive/Keyed.ts +23 -15
- package/src/shared/reactive/Reactive.ts +46 -1002
- package/src/shared/reactive/byOf.ts +2 -5
- package/src/shared/reactive/callLoad.ts +8 -14
- package/src/shared/reactive/cellShape.ts +734 -0
- package/src/shared/reactive/index.ts +12 -24
- package/src/shared/reactive/pairReactive.ts +5 -3
- package/src/shared/reactive/producer.ts +121 -0
- package/src/shared/reactive/scoped.ts +3 -2
- package/src/shared/reactive/selections.ts +209 -0
- package/src/shared/reactive/watch.ts +3 -4
- package/src/shared/rpc.ts +8 -5
- package/src/shared/validateJson.ts +1 -2
- package/src/shared/writePath.ts +29 -0
- package/src/ui/Router.ts +53 -69
- package/src/ui/outboxQueue.ts +2 -8
- package/src/ui/outcomeOf.ts +120 -0
- package/src/ui/socketWire.ts +3 -3
- package/src/ui/wire.ts +9 -10
- package/src/shared/LOAD_OFFLINE.ts +0 -15
- package/src/shared/LOAD_SIGNAL.ts +0 -10
- package/src/shared/issuesOf.ts +0 -18
- package/src/shared/reactive/ENTRY_LIVES.ts +0 -7
package/ABIDE.md
CHANGED
|
@@ -7,7 +7,7 @@ rather than guessing from Svelte, Vue or React. It installs with the package:
|
|
|
7
7
|
|
|
8
8
|
- `node_modules/@abide/abide/docs/abide.md` — every documentation page in reading order, with a
|
|
9
9
|
working example for each task. It is long: read its Contents, then search for the page's
|
|
10
|
-
address, which heads each page as a comment — `<!--
|
|
10
|
+
address, which heads each page as a comment — `<!-- guide/keep-it-current.md -->`.
|
|
11
11
|
- `node_modules/@abide/abide/docs/REGISTRY.md` — every name an app can import or write, with its
|
|
12
12
|
signature and the rules that govern it.
|
|
13
13
|
- `node_modules/@abide/abide/docs/RULEBOOK.md` — every rule, numbered. A compiler or server
|
|
@@ -46,6 +46,8 @@ affected code saying what it did, and tell the user.
|
|
|
46
46
|
your changes are done.
|
|
47
47
|
- `bun run dev` — serves the app on a local port and rebuilds when a file changes.
|
|
48
48
|
- `bun run build` then `bun run start` — the production build, and the app served from it.
|
|
49
|
+
- `docker build .` — the scaffold's `Dockerfile` runs `abide compile` and ships the one executable it
|
|
50
|
+
writes on a distroless image, and nothing else of the app (RULEBOOK 38.132).
|
|
49
51
|
|
|
50
52
|
## Layout
|
|
51
53
|
|
|
@@ -91,11 +93,12 @@ affected code saying what it did, and tell the user.
|
|
|
91
93
|
- Change part of a value by writing through its path — `edits.kind = kind`, `items.push(item)`
|
|
92
94
|
(RULEBOOK 31.8, 31.9) — not by rebuilding it (`edits = { ...edits, kind }`,
|
|
93
95
|
`items = [...items, item]`). Bind through the path too: `bind:value={edits.kind}` (32.5), not a
|
|
94
|
-
`{ get, set }` pair. In a `.ts` file the same write is
|
|
95
|
-
not `edits.set({ ...edits(), kind })`.
|
|
96
|
+
`{ get, set }` pair. In a `.ts` file the same write is
|
|
97
|
+
`edits.patch((value) => { value.kind = kind })`, not `edits.set({ ...edits(), kind })`.
|
|
96
98
|
- Derive a value with `reactive(() => …)`. `watch` is only for reaching outside the reactive graph —
|
|
97
|
-
the DOM, a timer, an imperative API — and never assigns state
|
|
98
|
-
|
|
99
|
+
the DOM, a timer, an imperative API — and its run never assigns state, a value computed from what
|
|
100
|
+
it read being a derived value. What a timer or a call it started hands back is written when that
|
|
101
|
+
lands, the way an event handler writes. A user action's effect belongs in its event handler. A `watch` runs during a server render too (RULEBOOK 12.5), so one that starts a
|
|
99
102
|
timer or touches a browser global returns a `Disposer`.
|
|
100
103
|
- A preference the page renders — a currency, a theme, a panel left open — lives in a cookie:
|
|
101
104
|
`const theme = reactive(() => cookies().get('theme') ?? 'light')`, written with
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @abide/abide
|
|
2
2
|
|
|
3
|
+
## 0.124.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cd07376: a throttled or debounced body is busy while its window holds a run, and an await waits for it — 5.15 ([`1482fd3`](https://github.com/briancray/abide/commit/1482fd3368675794ab6db48ff1ff2c5b8861d68c))
|
|
8
|
+
- cd07376: a bind: through a path is checked as the get/set pair the build emits — 32.5 ([`c91d03f`](https://github.com/briancray/abide/commit/c91d03f816af91f994314fc17b2101d8ec77ec51))
|
|
9
|
+
|
|
10
|
+
## 0.124.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 057aef8: `TypeSession` (from `@abide/abide/compiler`) no longer carries `hold`, `projectWith` or `projectionOf`. Every analysis now asks the shadow program through one `ShadowHost`, which owns the snapshot a question runs against, so a caller no longer holds the session and reaches for a raw project by hand.
|
|
15
|
+
- 1a7baec: `abide scaffold` writes a Dockerfile and `.dockerignore`: the app built with `abide compile` on the bun that scaffolded it, and an image on distroless holding the executable alone (RULEBOOK 38.132).
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- b50ba69: ABIDE.md points at a page address the bundled docs really carry (`guide/keep-it-current.md`), and names the scaffold's Dockerfile and `abide compile` (RULEBOOK 38.132)
|
|
20
|
+
- d3cee54: ABIDE.md says what a `watch` may write: its run assigns no state, and what a timer or a call it started hands back is written when that lands, as an event handler writes
|
|
21
|
+
- de50907: followers owned per app and passed to the mux ([`19e48d5`](https://github.com/briancray/abide/commit/19e48d5d12bdd12e648867e213442cdba0425cc1))
|
|
22
|
+
- de50907: a ShadowHost every analysis asks through, and one reads fixed point ([`1d3e371`](https://github.com/briancray/abide/commit/1d3e3710a5c42c09b44004b5142b47e09bcb20c6))
|
|
23
|
+
- de50907: split runDesktop into a DesktopSession and the window it drives ([`2174dc2`](https://github.com/briancray/abide/commit/2174dc22fea7c092b5ccf10807fd747fd632416c))
|
|
24
|
+
- 5221322: each test file under the test preload starts cold, so a file passes whatever order bun runs the files in — 38.133 ([`2afa677`](https://github.com/briancray/abide/commit/2afa67778caa5a15248d00cb6219078995b2d342))
|
|
25
|
+
- de50907: the selection index into selections.ts ([`4c58131`](https://github.com/briancray/abide/commit/4c581310ba08ccceaf213600b6f8166e186195c5))
|
|
26
|
+
- de50907: one issueReport module for note and issuesOf ([`4d2b85d`](https://github.com/briancray/abide/commit/4d2b85d88da14b474eaa7979347e5ca6ffc6e837))
|
|
27
|
+
- de50907: editor questions asked of the lowering a check registered ([`57d65a8`](https://github.com/briancray/abide/commit/57d65a8c009d4e4b3a740362e7e85ee97a9e3b10))
|
|
28
|
+
- de50907: one module owns the call starting a load ([`8331a7d`](https://github.com/briancray/abide/commit/8331a7df809e0f851a3ebb1d4b99f0b708d1d2be))
|
|
29
|
+
- de50907: a producer port for the verbs outside the core spend ([`84bfbbd`](https://github.com/briancray/abide/commit/84bfbbddcc96ed6dbaec78348d279c5873269698))
|
|
30
|
+
- de50907: one handler invocation for the http and socket lanes ([`8828727`](https://github.com/briancray/abide/commit/8828727a3c2fa24b8c5b37ef8b580aaaf874c0d2))
|
|
31
|
+
- de50907: declare the Cell shape once, in cellShape.ts ([`8fee2f4`](https://github.com/briancray/abide/commit/8fee2f49e63535e92e59240531669794b6f23b16))
|
|
32
|
+
- de50907: the reads fixed point returns its answers rather than filling the caller's ([`c704569`](https://github.com/briancray/abide/commit/c7045690405bb633c329a5252429485eca03d5c8))
|
|
33
|
+
- de50907: decide a navigation's outcome in a pure outcomeOf, executed by Router ([`dc055fc`](https://github.com/briancray/abide/commit/dc055fc290782ebd9b4ea50b0db23a4c408835a4))
|
|
34
|
+
- de50907: one page-render session owns seeding, recording and early calls ([`fcfb07a`](https://github.com/briancray/abide/commit/fcfb07aa398cedafdbd5cef87cecb022c712f6fa))
|
|
35
|
+
- d870b05: `abide format` opens an expression `bun fmt` breaks onto lines of its own at its brace — `{name` rather than `{ name` — the first line outdented like the rest (RULEBOOK 38.126).
|
|
36
|
+
- 5e3caa6: An array mutator called on a reactive name in a `.abide` file is a write: `tags.push(tag)`, `deal.notes.splice(0, 1)` and the rest run on a copy that the name then holds, so the page repaints (RULEBOOK 31.9). The receiver's type decides it — a class's own `push` or a `Map`'s `set` is still the value's call. ABIDE.md names `items.push(item)` as the write again.
|
|
37
|
+
- 2350996: A page's module, and every module it imports, is now evaluated outside the request that first renders it. In an executable `abide compile` writes, a module's `reactive` was built as the first request's own rather than per request, so whatever that request left — a signed-out caller's refusal — stood for every caller after it (RULEBOOK 11.67).
|
|
38
|
+
- d98f382: `abide scaffold`'s `bunfig.toml` comments fit the 80-column line the formatter prints.
|
|
39
|
+
- 37dddd1: A file with no extension imported `with { type: 'text' }` — a `Dockerfile`, a `LICENSE`, a `Makefile` — is its text under `abide dev` and `abide start`, where the page used to answer 500 (RULEBOOK 34.21).
|
|
40
|
+
|
|
3
41
|
## 0.123.3
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/docs/REGISTRY.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Every name an app author can write, with its type and what it is.
|
|
4
4
|
|
|
5
|
+
`@abide/abide/compiler`, and the `/runtime`, `/routing` and `/wire` entries a compiled bundle
|
|
6
|
+
imports, are tooling rather than surface an app author writes, and none of their names is a row.
|
|
7
|
+
|
|
5
8
|
## What this document is
|
|
6
9
|
|
|
7
10
|
A **registry**. One row per name, and the row answers exactly one question: *what is this?*
|
|
@@ -51,6 +54,7 @@ Accepted, Failures>` is the inner value's own `Accepted`. Then `Failures`, then
|
|
|
51
54
|
| Name | Signature | Meaning | Rules |
|
|
52
55
|
| --- | --- | --- | --- |
|
|
53
56
|
| `Reactive` | `Reactive<Stored = undefined, Accepted = Stored, Failures = never, Produced = Stored>` | The value type every producer in this design hands back. | 1.1, 1.2, 1.3, 1.4, 1.6, 1.7, 1.8, 9.1, 9.14 |
|
|
57
|
+
| `isReactive` | `(value: unknown) => value is Reactive<unknown>` | Whether a value is a `Reactive`. | 1.6 |
|
|
54
58
|
| `Keyed` | `Keyed<Stored, Args, Accepted = Stored, Failures = never, Produced = Stored>` | What a body declaring a parameter hands back: a factory carrying the probes and the triggers. | 4.13, 11.2, 11.4, 11.6, 11.23, 11.55 |
|
|
55
59
|
| `Accepted` | `unknown` | What a factory and a write take, before the gates run. | 4.1, 4.2 |
|
|
56
60
|
| `Stored` | `unknown` | What is held, and what a read returns. | 4.7, 5.2 |
|
|
@@ -213,28 +217,45 @@ type Gated<Gate, Accepted> = [Schema<Accepted>] extends [Gate] ? never : Failed<
|
|
|
213
217
|
|
|
214
218
|
| Name | Signature | Meaning | Rules |
|
|
215
219
|
| --- | --- | --- | --- |
|
|
216
|
-
| `Rpc` | `<Value, Args, Failures, Produced = Value>(args?: Args, options?: { signal?: AbortSignal; offline?: (args: Args) => Value }) => Reactive<Value, Value, Failures \| Failed<'HttpError', undefined>, Produced>` | A handler reached over http, or in process on a server. | 16.3, 16.4, 16.8, 16.11, 16.25, 16.26, 16.27, 16.28, 16.29, 16.33, 16.43, 16.48, 16.49, 16.62, 41.5, 41.7, 41.12, 41.21, 41.22, 41.25, 41.26, 41.27, 16.79, 16.80, 16.85 |
|
|
220
|
+
| `Rpc` | `<Value, Args, Failures = never, Produced = Value>(args?: Args, options?: { signal?: AbortSignal; offline?: (args: Args) => Value }) => Reactive<Value, Value, Failures \| Failed<'HttpError', undefined> \| Annotated<Args>, Produced>` | A handler reached over http, or in process on a server. | 16.3, 16.4, 16.8, 16.11, 16.25, 16.26, 16.27, 16.28, 16.29, 16.33, 16.43, 16.48, 16.49, 16.62, 41.5, 41.7, 41.12, 41.21, 41.22, 41.25, 41.26, 41.27, 16.79, 16.80, 16.85 |
|
|
217
221
|
| `offline` | `(args: Args) => Value` | What a call settles to where a browser could not get its answer. | 16.81, 16.82, 16.83, 16.84 |
|
|
218
222
|
| `Value` | `unknown` | What the addressed `Reactive` holds. | 16.3, 16.30 |
|
|
219
223
|
| `Produced` | `unknown` | What it yields, per the unit rule. | 1.2, 16.3 |
|
|
220
224
|
| `Args` | `Record<string, JsonValue> \| undefined` | The arguments, in the body on a mutation and in the URL on a `GET` or `DELETE`. | 11.24, 16.18, 19.15 |
|
|
221
225
|
| `Middleware` | `Middleware<Answer = never, Extra extends object = object> = <Given extends { request: Request } & Extra, Result>(next: (ctx?: Given) => Promise<Result>, ctx: Given) => Result \| Answer \| Failed<string, unknown> \| Promise<Result \| Answer \| Failed<string, unknown>>` | One rung, written once for every lane whose context carries `Extra`. | 16.14, 16.15, 16.16, 16.21, 37.14, 37.15 |
|
|
222
|
-
| `GET` | `<
|
|
223
|
-
| `GET` | `<
|
|
224
|
-
| `GET` | `<
|
|
226
|
+
| `GET` | `<Stored, Accepted, Failures, Produced>(handler: Reactive<Stored, Accepted, Failures, Produced>, options?: RpcOptions<undefined>) => Rpc<Stored, undefined, Failures, Produced>` | Declares a read any surface may call. | 16.1, 16.2, 16.5, 16.6, 16.30, 16.31, 16.32, 16.68, 16.76, 16.34, 16.35, 16.36, 16.37, 16.39, 16.44, 16.45, 16.46, 16.47, 16.75, 16.50, 16.51, 16.52, 16.64, 18.1, 18.3, 18.6, 18.8, 18.10, 18.12, 18.21, 18.24, 18.27 |
|
|
227
|
+
| `GET` | `<Stored, Args, Accepted, Failures, Produced>(handler: Keyed<Stored, Args, Accepted, Failures, Produced>, options?: RpcOptions<Args>) => Rpc<Stored, Args, Failures, Produced>` | The keyed overload, for a `Keyed` given an address. | 11.2, 16.1, 16.3, 16.6 |
|
|
228
|
+
| `GET` | `<Chunk, Shaped = Chunk[], Gate = Schema<Chunk[]>>(handler: () => AsyncGenerator<Chunk> \| Promise<AsyncGenerator<Chunk>>, options?: Shaping<Chunk[], Shaped, never, Gate> & RpcOptions<undefined>) => Rpc<Kept<Shaped>, undefined, Refusals<Shaped, Gate, Chunk[]>, Chunk>` | The streaming overload, whose options build the value it becomes beside its address. | 16.1, 16.6, 16.7, 16.44, 16.45, 16.46, 16.47 |
|
|
229
|
+
| `GET` | `<Chunk, Args, Shaped = Chunk[], Gate = Schema<Chunk[]>, ArgsGate = Schema<Args>>(handler: (args: Args) => AsyncGenerator<Chunk> \| Promise<AsyncGenerator<Chunk>>, options?: Shaping<Chunk[], Shaped, Args, Gate, ArgsGate> & RpcOptions<Args>) => Rpc<Kept<Shaped>, Args, Refusals<Shaped, Gate, Chunk[], ArgsGate, Args>, Chunk>` | The keyed streaming overload. | 11.2, 16.1, 16.6, 16.7 |
|
|
230
|
+
| `GET` | `<Chunk, Args, Shaped = Chunk[], Gate = Schema<Chunk[]>, ArgsGate = Schema<Args \| undefined>>(handler: (args?: Args) => AsyncGenerator<Chunk> \| Promise<AsyncGenerator<Chunk>>, options?: Shaping<Chunk[], Shaped, Args \| undefined, Gate, ArgsGate> & RpcOptions<Args \| undefined>) => Rpc<Kept<Shaped>, Args \| undefined, Refusals<Shaped, Gate, Chunk[], ArgsGate, Args \| undefined>, Chunk>` | The keyed streaming overload for a body whose parameter is optional. | 11.2 |
|
|
231
|
+
| `GET` | `<Computed, Shaped = Awaited<Computed>, Gate = Schema<Awaited<Computed>>>(handler: () => Computed, options?: Shaping<Awaited<Computed>, Shaped, never, Gate> & RpcOptions<undefined>) => Rpc<Kept<Shaped>, undefined, AdoptedFailures<Computed> \| Refusals<Shaped, Gate, Awaited<Computed>>, AdoptedProduced<Computed, Kept<Shaped>>>` | The plain-function overload, whose options (`ttl`, `global`, `debounce` and the rest) build the value it becomes beside its address. | 16.1, 16.6, 16.7 |
|
|
232
|
+
| `GET` | `<Computed, Args, Shaped = Awaited<Computed>, Gate = Schema<Awaited<Computed>>, ArgsGate = Schema<Args>>(handler: (args: Args) => Computed, options?: Shaping<Awaited<Computed>, Shaped, Args, Gate, ArgsGate> & RpcOptions<Args>) => Rpc<Kept<Shaped>, Args, AdoptedFailures<Computed> \| Refusals<Shaped, Gate, Awaited<Computed>, ArgsGate, Args>, AdoptedProduced<Computed, Kept<Shaped>>>` | The keyed plain-function overload. | 11.2, 16.1, 16.6, 16.7 |
|
|
233
|
+
| `GET` | `<Computed, Args, Shaped = Awaited<Computed>, Gate = Schema<Awaited<Computed>>, ArgsGate = Schema<Args \| undefined>>(handler: (args?: Args) => Computed, options?: Shaping<Awaited<Computed>, Shaped, Args \| undefined, Gate, ArgsGate> & RpcOptions<Args \| undefined>) => Rpc<Kept<Shaped>, Args \| undefined, AdoptedFailures<Computed> \| Refusals<Shaped, Gate, Awaited<Computed>, ArgsGate, Args \| undefined>, AdoptedProduced<Computed, Kept<Shaped>>>` | The keyed plain-function overload for a body whose parameter is optional. | 11.2 |
|
|
234
|
+
| `GET` | `<Accepted, Shaped = Accepted, Gate = Schema<Accepted>>(handler: Accepted \| PromiseLike<Accepted>, options?: Shaping<Accepted, Shaped, never, Gate> & RpcOptions<undefined>) => Rpc<Kept<Shaped>, undefined, Refusals<Shaped, Gate, Accepted>>` | The value overload, for what the handler owns outright, whose options build the value it becomes. | 16.1, 16.6, 16.7 |
|
|
225
235
|
| `POST` / `PUT` / `PATCH` / `DELETE` | same as `GET` | Declares a mutation. | 16.2, 16.7, 16.32, 16.68, 16.76, 16.38, 16.53 |
|
|
226
236
|
| `rpc.busy` | `(pattern?: Partial<Args>) => boolean` | `busy` narrowed to the handler's matching entries. | 13.2, 13.3, 13.12, 13.19, 46.11 |
|
|
227
237
|
| `rpc.ready` | `(pattern?: Partial<Args>) => boolean` | `ready` narrowed to the handler's matching entries. | 13.11, 13.12, 13.19 |
|
|
228
238
|
| `rpc.synced` | `(pattern?: Partial<Args>) => boolean` | `synced` narrowed to the handler's matching entries. | 13.12, 13.18, 13.19 |
|
|
229
239
|
| `rpc.invalidate` | `(pattern?: Partial<Args>) => void` | `invalidate` narrowed to the handler's matching entries. | 7.2, 7.3, 13.4, 13.12, 13.19 |
|
|
230
240
|
| `rpc.refresh` | `(pattern?: Partial<Args>) => void` | `refresh` narrowed to the handler's matching entries. | 7.4, 7.5, 13.4, 13.12, 13.19 |
|
|
231
|
-
| `rpc.isError` | `<Name extends
|
|
241
|
+
| `rpc.isError` | `<Name extends string>(error: unknown, name: Name) => error is Extract<Failures \| Failed<'HttpError', undefined> \| Annotated<Args>, { name: Name }>` | Whether a caught failure is the one named. | 16.8 |
|
|
232
242
|
| `rpc.raw` | `(args: Args, init?: RequestInit) => Promise<Response>` | The same call handed back as the raw response. | 16.11, 16.42 |
|
|
233
243
|
| `rpc.method` | `string` | The HTTP method. | 16.2 |
|
|
234
244
|
| `rpc.url` | `(args?: Args) => string` | The address, resolved against the mount. | 16.9, 16.10, 30.28 |
|
|
235
245
|
| `rpc.description` | `string \| undefined` | The human description. | 16.28 |
|
|
236
246
|
| `PatchOp` | `{ op: 'add' \| 'replace' \| 'test'; path: string; value: unknown } \| { op: 'remove'; path: string } \| { op: 'move' \| 'copy'; from: string; path: string }` | One JSON Patch operation (RFC 6902), its paths JSON Pointers, as a followed `GET` is sent what an `s.patch` wrote. | 18.11, 18.13 |
|
|
237
247
|
|
|
248
|
+
The aliases a call's failures and a plain handler's options are spelled through are declared
|
|
249
|
+
rather than listed, none of them being a name an app writes. `Annotated` is the `ValidationError` of
|
|
250
|
+
16.8, `never` wherever 19.9 derives no object's schema from `Args`:
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
type Annotated<Args> = 0 extends 1 & Args ? never : unknown extends Args ? never : Derived<Exclude<Args, undefined>>
|
|
254
|
+
type Derived<Member, Whole = Member> = Member extends readonly unknown[] | ((...given: never[]) => unknown) ? never : Member extends object ? [Whole] extends [Member] ? [keyof Member] extends [never] ? [string] extends [Member] ? Failed<'ValidationError', Issues<Whole>> : never : Failed<'ValidationError', Issues<Whole>> : never : never
|
|
255
|
+
type Shaping<Accepted, Shaped, Args = never, Gate = Schema<Accepted>, ArgsGate = Schema<Args>> = Omit<ReactiveOptions<Accepted, Kept<NoInfer<Shaped>>, never, Args>, 'transform' | 'schema' | 'args'> & { transform?: (value: Accepted) => Shaped; schema?: Gate & Schema<Accepted>; args?: [Args] extends [never] ? never : ArgsGate & Schema<Args> }
|
|
256
|
+
type Refusals<Shaped, Gate, Stored, ArgsGate = Schema<never>, Args = never> = Refused<Shaped> | Gated<Gate, Stored> | Gated<ArgsGate, Args>
|
|
257
|
+
```
|
|
258
|
+
|
|
238
259
|
### `RpcOptions`
|
|
239
260
|
|
|
240
261
|
| Name | Signature | Meaning | Rules |
|
|
@@ -349,9 +370,9 @@ type Gated<Gate, Accepted> = [Schema<Accepted>] extends [Gate] ? never : Failed<
|
|
|
349
370
|
|
|
350
371
|
| Name | Signature | Meaning | Rules |
|
|
351
372
|
| --- | --- | --- | --- |
|
|
352
|
-
| `claudeCode` | `(config?: ClaudeCodeConfig) => Provider` | The visitor's own Claude Code, reached through the bridge paired with their browser, as a provider. | 44.5, 44.13, 44.17, 44.18, 44.19, 44.
|
|
373
|
+
| `claudeCode` | `(config?: ClaudeCodeConfig) => Provider` | The visitor's own Claude Code, reached through the bridge paired with their browser, as a provider. | 44.5, 44.13, 44.17, 44.18, 44.19, 44.33 |
|
|
353
374
|
| `ClaudeCodeConfig` | `{ model?: string; fallbackModel?: string; systemPrompt?: string; appendSystemPrompt?: string; effort?: 'low' \| 'medium' \| 'high' \| 'xhigh' \| 'max'; maxBudgetUsd?: number; betas?: string[]; disallowedTools?: string[]; tools?: string[] }` | The Claude Code options a site may set for a turn, and the built-in tools it asks the visitor for. | 44.16, 44.29 |
|
|
354
|
-
| `claudeCode.bridgeCommand` | `(options?: { tools?: string[] }) => { command: string; link: string; expires: number }` | The command and the link that pair a bridge with this browser, granting the built-in tools it is given. | 44.14, 44.32, 44.33, 44.40
|
|
375
|
+
| `claudeCode.bridgeCommand` | `(options?: { tools?: string[] }) => { command: string; link: string; expires: number }` | The command and the link that pair a bridge with this browser, granting the built-in tools it is given. | 44.14, 44.32, 44.33, 44.40 |
|
|
355
376
|
| `claudeCode.bridge` | `(options?: { tools?: string[] }) => AsyncGenerator<BridgeStatus>` | This browser's pairing, as it changes. | 44.20, 44.22, 44.32, 44.33, 44.34, 44.40 |
|
|
356
377
|
| `BridgeStatus` | `{ paired: boolean; command: string \| undefined; link: string \| undefined }` | Whether a bridge is paired, and the command and the link that pair one where none is. | 44.20, 44.40 |
|
|
357
378
|
| `/__abide/bridge` | `GET`, `POST` | Where a bridge pairs, and is relayed its turns. | 36.7, 44.14, 44.15, 44.19, 44.23, 44.26, 16.57, 16.78 |
|
|
@@ -362,7 +383,8 @@ type Gated<Gate, Accepted> = [Schema<Accepted>] extends [Gate] ? never : Failed<
|
|
|
362
383
|
|
|
363
384
|
| Name | Signature | Meaning | Rules |
|
|
364
385
|
| --- | --- | --- | --- |
|
|
365
|
-
| `cookies` | `() =>
|
|
386
|
+
| `cookies` | `() => Cookies` | The cookies of the request being served, live and mutable. | 22.2, 22.3, 22.4, 22.5, 22.6, 22.7, 22.8, 22.10 |
|
|
387
|
+
| `Cookies` | `class Cookies implements Iterable<[string, string]> { get(name: string): string \| null; has(name: string): boolean; set(name: string, value: string, options?: CookieInit): void; set(options: CookieInit): void; delete(name: string, options?: Omit<CookieStoreDeleteOptions, 'name'>): void; delete(options: CookieStoreDeleteOptions): void; size: number; toJSON(): Record<string, string>; toSetCookieHeaders(): string[] }` | A cookie jar shaped like Bun's `CookieMap`. | 22.4, 22.5, 22.6 |
|
|
366
388
|
|
|
367
389
|
## `request`
|
|
368
390
|
|
|
@@ -499,7 +521,7 @@ type Gated<Gate, Accepted> = [Schema<Accepted>] extends [Gate] ? never : Failed<
|
|
|
499
521
|
|
|
500
522
|
| Name | Signature | Meaning | Rules |
|
|
501
523
|
| --- | --- | --- | --- |
|
|
502
|
-
| `csp` | `(sources?: Record<string, string[]>) => (next: (ctx?: { request: Request }) => Promise<Response>, ctx: { request: Request }) => Promise<Response>` | The rung that sets `content-security-policy`. | 29.1, 29.2, 29.5, 29.6, 29.7, 29.8 |
|
|
524
|
+
| `csp` | `(sources?: Record<string, string[]>) => (next: (ctx?: { request: Request }) => Promise<Response>, ctx: { request: Request }) => Response \| Promise<Response>` | The rung that sets `content-security-policy`. | 29.1, 29.2, 29.5, 29.6, 29.7, 29.8 |
|
|
503
525
|
| `csp.nonce` | `() => string` | This response's nonce, for the app's own inline script. | 29.3, 29.4, 29.9, 29.11 |
|
|
504
526
|
|
|
505
527
|
## `url`
|
|
@@ -539,7 +561,7 @@ type Gated<Gate, Accepted> = [Schema<Accepted>] extends [Gate] ? never : Failed<
|
|
|
539
561
|
| `foo.push(v)` | the same | 31.8, 31.9 |
|
|
540
562
|
| `const [a, b] = foo` / `...foo` | one read of the value | 31.12 |
|
|
541
563
|
| `foo.bar` | the value's `bar`, or the `Reactive`'s own `bar` where it declares one the value does not | 31.5 |
|
|
542
|
-
| `foo.bar(…)` | the `Reactive`
|
|
564
|
+
| `foo.bar(…)` | a call of the value's `bar`, or of the `Reactive`'s own `bar` where it declares one the value does not | 31.6 |
|
|
543
565
|
| `foo()` / `foo.set(v)` | the explicit forms | 31.7, 31.11 |
|
|
544
566
|
|
|
545
567
|
## Templating
|
|
@@ -850,7 +872,7 @@ rows a runner prints, and an adapter for an abide app.
|
|
|
850
872
|
|
|
851
873
|
| Name | Meaning | Rules |
|
|
852
874
|
| --- | --- | --- |
|
|
853
|
-
| `preload = ["@abide/harness/abide/preload"]` | The `[test]` preload that registers a DOM a test mounts into and measures, then abide's own. | 38.109, 38.119 |
|
|
875
|
+
| `preload = ["@abide/harness/abide/preload"]` | The `[test]` preload that registers a DOM a test mounts into and measures, then abide's own. | 38.109, 38.119, 38.133 |
|
|
854
876
|
|
|
855
877
|
# CLI
|
|
856
878
|
|
|
@@ -858,7 +880,7 @@ rows a runner prints, and an adapter for an abide app.
|
|
|
858
880
|
|
|
859
881
|
| Command | Meaning | Rules |
|
|
860
882
|
| --- | --- | --- |
|
|
861
|
-
| `abide scaffold <name>` | Writes a starter project. | 38.1, 38.42, 38.103, 38.104, 38.106, 38.112, 38.122, 38.124, 38.131 |
|
|
883
|
+
| `abide scaffold <name>` | Writes a starter project. | 38.1, 38.42, 38.103, 38.104, 38.106, 38.112, 38.122, 38.124, 38.131, 38.132 |
|
|
862
884
|
| `abide run <file> [args…]` | Runs a script under the abide runtime. | 38.2, 38.57 |
|
|
863
885
|
| `abide check [dir…]` | The type-checker over a `.abide` tree. | 38.3, 38.31, 38.32, 38.33, 38.40, 38.105, 38.123 |
|
|
864
886
|
| `abide format [--check] [dir…]` | The formatter over a `.abide` tree. | 38.25, 38.125, 38.126, 38.127, 38.128, 38.129 |
|
|
@@ -876,3 +898,14 @@ rows a runner prints, and an adapter for an abide app.
|
|
|
876
898
|
| `abide lsp` | The `.abide` language server, over stdio. | 38.11, 38.34, 38.39, 38.98, 38.116, 38.117, 38.118, 38.130 |
|
|
877
899
|
| `--help` · `-h` · `abide help` | Usage, generated from the command list. | 38.12, 38.113, 38.114 |
|
|
878
900
|
| `--version` · `-v` | The version of abide, or of the app a compiled executable holds. | 38.115 |
|
|
901
|
+
|
|
902
|
+
## `abide-bridge` — the bridge
|
|
903
|
+
|
|
904
|
+
`@abide/bridge`, a package of its own: what a visitor runs to put their own Claude Code behind a
|
|
905
|
+
site's `claudeCode`.
|
|
906
|
+
|
|
907
|
+
| Command | Meaning | Rules |
|
|
908
|
+
| --- | --- | --- |
|
|
909
|
+
| `abide-bridge <site> <code> [--claude <path>] [--env NAME=VALUE]… [-- <options>]` | This machine's Claude Code, paired with the browser a site minted the code for. | 44.15, 44.16, 44.24, 44.25, 44.27, 44.30, 44.44, 44.45, 44.46, 44.47 |
|
|
910
|
+
| `abide-bridge install [--claude <path>] [--env NAME=VALUE]… [-- <options>]` | The app that opens a site's `abide-bridge` links on this machine, registered. | 44.41, 44.42, 44.43, 44.44 |
|
|
911
|
+
| `abide-bridge uninstall` | `abide-bridge install`, undone. | 44.43 |
|
package/docs/RULEBOOK.md
CHANGED
|
@@ -290,8 +290,8 @@ two is a comparator answering directly.
|
|
|
290
290
|
|
|
291
291
|
5.14 Declaring both `throttle` and `debounce` MUST refuse at construction.
|
|
292
292
|
|
|
293
|
-
5.15 Where a `throttle` or a `debounce` window is holding a production back,
|
|
294
|
-
|
|
293
|
+
5.15 Where a `throttle` or a `debounce` window is holding a production back, or a body's run under
|
|
294
|
+
5.11, the value served before it MUST go on being served and `s.busy` MUST be true.
|
|
295
295
|
|
|
296
296
|
5.16 A `bind:` read MUST NOT be capped.
|
|
297
297
|
|
|
@@ -1559,9 +1559,11 @@ error naming the mount.
|
|
|
1559
1559
|
23.21 A `.abide` of the app's own directly in a directory under no fence MUST be a page, save a
|
|
1560
1560
|
`layout.abide`, an `error.abide` and the root's `launcher.abide`.
|
|
1561
1561
|
|
|
1562
|
-
23.22 A file of the app's own directly in a directory under no fence
|
|
1563
|
-
handler
|
|
1564
|
-
|
|
1562
|
+
23.22 A file of the app's own directly in a directory under no fence MUST be a `.abide`, a handler
|
|
1563
|
+
file (`<name>.handler.ts`), a param file (`<NAME>.param.ts`), a test file (`<name>.test.ts`), a bench
|
|
1564
|
+
file (`<name>.bench.ts`) or a declaration file (`<name>.d.ts`), and any other MUST be a build error
|
|
1565
|
+
naming the file and a `lib` directory — save a file directly in a root that holds its package's
|
|
1566
|
+
`package.json`, which MAY be any file but a `.ts`.
|
|
1565
1567
|
|
|
1566
1568
|
23.23 A server file of the app's own under no `lib` directory MUST be a build error naming the file
|
|
1567
1569
|
and a `lib` directory.
|
|
@@ -1891,8 +1893,8 @@ member, and the value's method otherwise.
|
|
|
1891
1893
|
31.8 A write through a member path into plain data MUST copy down that path and then write, and the
|
|
1892
1894
|
copy MUST NOT be optimized away.
|
|
1893
1895
|
|
|
1894
|
-
31.9 A mutator
|
|
1895
|
-
the member name.
|
|
1896
|
+
31.9 A call of an array's mutator through a member path MUST be a write per 31.8, run on a copy of
|
|
1897
|
+
the receiver, and MUST be resolved from the type of the receiver rather than from the member name.
|
|
1896
1898
|
|
|
1897
1899
|
31.10 A template-local binding MUST shadow a name bound to a `Reactive` for the body it is bound in.
|
|
1898
1900
|
|
|
@@ -1903,8 +1905,8 @@ the member name.
|
|
|
1903
1905
|
31.13 A name MUST hold the `Reactive` where the declared type of its position is a `Selection`, or a
|
|
1904
1906
|
type parameter constrained by one.
|
|
1905
1907
|
|
|
1906
|
-
31.14 A write through a member path that reaches a value which is not plain data —
|
|
1907
|
-
object whose prototype is `Object.prototype` or `null` — MUST assign on that value itself, MUST NOT
|
|
1908
|
+
31.14 A write through a member path that reaches a value which is not plain data — anything but an
|
|
1909
|
+
array or an object whose prototype is `Object.prototype` or `null` — MUST assign on that value itself, MUST NOT
|
|
1908
1910
|
copy it or any level above it, and MUST NOT wake a reader.
|
|
1909
1911
|
|
|
1910
1912
|
31.15 `route.url`, `route.params`, `route.name` and `route.navigating` MUST each be read and written
|
|
@@ -2281,8 +2283,9 @@ loads MUST NOT carry it.
|
|
|
2281
2283
|
34.20 A `<script server>` in a `.abide` file of the app's own under a `public` directory MUST be a
|
|
2282
2284
|
compile error.
|
|
2283
2285
|
|
|
2284
|
-
34.21 A file a script block imports `with { type: 'text' }`, a `.abide`
|
|
2285
|
-
as its text and typed a `string`, on a server, in a browser
|
|
2286
|
+
34.21 A file a script block imports `with { type: 'text' }`, a `.abide` and a file whose name has no
|
|
2287
|
+
extension among them, MUST be imported as its text and typed a `string`, on a server, in a browser
|
|
2288
|
+
and to the checker alike.
|
|
2286
2289
|
|
|
2287
2290
|
34.22 A binding a `<script server>` imports that its file's `<script module>` or `<script>` imports
|
|
2288
2291
|
from the same specifier under the same name MUST compile as that one binding, a value wherever any
|
|
@@ -2863,6 +2866,12 @@ editor holds.
|
|
|
2863
2866
|
38.131 The project `abide scaffold` writes MUST carry Tailwind wired: `bun-plugin-tailwind` declared
|
|
2864
2867
|
in its `bunfig.toml` (38.43), and a stylesheet importing `tailwindcss` that its root layout imports.
|
|
2865
2868
|
|
|
2869
|
+
38.132 The project `abide scaffold` writes MUST carry a Dockerfile whose image holds the executable
|
|
2870
|
+
`abide compile` writes and nothing else of the app.
|
|
2871
|
+
|
|
2872
|
+
38.133 Under `bun test` with `@abide/abide/test` preloaded, each test file after the first in a
|
|
2873
|
+
process MUST start as a bare `invalidate` (13.6) leaves the values the files before it loaded.
|
|
2874
|
+
|
|
2866
2875
|
# 39. Head and view transitions
|
|
2867
2876
|
|
|
2868
2877
|
39.1 A `<head>` element in a `.abide` file MUST contribute its children to the document head.
|
|
@@ -2968,7 +2977,8 @@ NOT be answered by a fixture.
|
|
|
2968
2977
|
|
|
2969
2978
|
40.16 Instrumentation the documentation adds to an `<Example>` MUST sit outside the render.
|
|
2970
2979
|
|
|
2971
|
-
40.17 A page MUST embed one `<Example>` per behavior it teaches, save a page 40.35
|
|
2980
|
+
40.17 A page MUST embed one `<Example>` per behavior it teaches, save a page or a section 40.35
|
|
2981
|
+
exempts.
|
|
2972
2982
|
|
|
2973
2983
|
40.18 An `<Example>` MUST demonstrate exactly one behavior.
|
|
2974
2984
|
|
|
@@ -3014,11 +3024,11 @@ about.
|
|
|
3014
3024
|
40.34 The documentation site MUST serve `docs/RULEBOOK.md` at `/rulebook`, read from the file as the
|
|
3015
3025
|
site builds, with each clause and each group anchored by its own number.
|
|
3016
3026
|
|
|
3017
|
-
40.35 A page whose every behavior is performed by a command, or decided by the
|
|
3018
|
-
served from, MAY embed no `<Example>`.
|
|
3027
|
+
40.35 A page, or a section of one, whose every behavior is performed by a command, or decided by the
|
|
3028
|
+
deployment an app is served from, MAY embed no `<Example>`.
|
|
3019
3029
|
|
|
3020
|
-
40.36 A page embedding no `<Example>` under 40.35 MUST name which of the two in its `SITE`
|
|
3021
|
-
`cardless`.
|
|
3030
|
+
40.36 A page embedding no `<Example>` at all under 40.35 MUST name which of the two in its `SITE`
|
|
3031
|
+
entry's `cardless`.
|
|
3022
3032
|
|
|
3023
3033
|
40.37 The documentation site MUST serve each chapter's feature directory at the address the chapter
|
|
3024
3034
|
app serves it at, with none of the site's chrome around its pages.
|
|
@@ -3440,6 +3450,9 @@ report is taken, and MUST NOT say it while it redials per 44.25.
|
|
|
3440
3450
|
44.46 A bridge MUST end a turn once `/__abide/bridge` did not take a report carrying it, and MUST
|
|
3441
3451
|
report that turn failed.
|
|
3442
3452
|
|
|
3453
|
+
44.47 A bridge MUST reach `/__abide/bridge` over a certificate that either bun's own authorities or
|
|
3454
|
+
the authorities its machine trusts sign, however the bridge was started.
|
|
3455
|
+
|
|
3443
3456
|
# 45. Offline
|
|
3444
3457
|
|
|
3445
3458
|
45.1 Where `ABIDE_OFFLINE` is on, a page `abide build` built MUST register the worker
|