@abide/abide 0.124.1 → 0.125.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.
Files changed (74) hide show
  1. package/ABIDE.md +4 -0
  2. package/CHANGELOG.md +50 -0
  3. package/bin/abide.ts +3 -2
  4. package/docs/REGISTRY.md +67 -40
  5. package/docs/RULEBOOK.md +206 -18
  6. package/docs/abide.md +393 -67
  7. package/package.json +1 -1
  8. package/src/compiler/appMap.ts +14 -1
  9. package/src/compiler/compileApp.ts +1 -0
  10. package/src/compiler/declaredExports.ts +41 -0
  11. package/src/compiler/handlersUnder.ts +1 -0
  12. package/src/compiler/hookCalls.ts +1 -0
  13. package/src/compiler/projectShadow.ts +52 -2
  14. package/src/compiler/readsIn.ts +39 -34
  15. package/src/server/PageRender.ts +7 -8
  16. package/src/server/abideModules.ts +22 -9
  17. package/src/server/addressed.ts +14 -0
  18. package/src/server/answerRequest.ts +115 -52
  19. package/src/server/answerSocket.ts +6 -5
  20. package/src/server/answerWorker.ts +34 -23
  21. package/src/server/assistant.ts +141 -35
  22. package/src/server/banner.ts +9 -5
  23. package/src/server/bridgeRelay.ts +3 -3
  24. package/src/server/callerOf.ts +5 -0
  25. package/src/server/claudeCode.ts +20 -11
  26. package/src/server/commands.ts +14 -7
  27. package/src/server/createApp.ts +65 -12
  28. package/src/server/devWorker.ts +18 -16
  29. package/src/server/faceOf.ts +3 -1
  30. package/src/server/generatedSurfaces.ts +6 -5
  31. package/src/server/handlerFileMount.ts +2 -0
  32. package/src/server/hooks.ts +54 -8
  33. package/src/server/index.ts +21 -4
  34. package/src/server/invokeHandler.ts +1 -1
  35. package/src/server/mountHandlers.ts +9 -7
  36. package/src/server/principal.ts +3 -2
  37. package/src/server/render.ts +11 -2
  38. package/src/server/requestScope.ts +61 -1
  39. package/src/server/responseRelay.ts +9 -3
  40. package/src/server/serveDev.ts +18 -3
  41. package/src/server/sqliteStore.ts +65 -0
  42. package/src/server/testMount.ts +1 -0
  43. package/src/shared/AssistantEvent.ts +40 -0
  44. package/src/shared/BrowserHooks.ts +73 -0
  45. package/src/shared/CURRENT_ROUTER.ts +3 -1
  46. package/src/shared/Issues.ts +11 -3
  47. package/src/shared/Middleware.ts +14 -7
  48. package/src/shared/UNEXPECTED.ts +1 -1
  49. package/src/shared/answerOf.ts +9 -4
  50. package/src/shared/imagePiece.ts +85 -0
  51. package/src/shared/index.ts +17 -0
  52. package/src/shared/isServer.ts +15 -0
  53. package/src/shared/navigate.ts +10 -3
  54. package/src/shared/onError.ts +51 -0
  55. package/src/shared/onRefusal.ts +47 -0
  56. package/src/shared/online.ts +5 -1
  57. package/src/shared/reactive/Keyed.ts +12 -1
  58. package/src/shared/reactive/Reactive.ts +53 -25
  59. package/src/shared/reactive/cellShape.ts +4 -3
  60. package/src/shared/reactive/poll.ts +49 -0
  61. package/src/shared/reactive/scoped.ts +10 -1
  62. package/src/shared/reactive/scoping.ts +14 -0
  63. package/src/shared/reactive/watch.ts +19 -8
  64. package/src/shared/resultsOf.ts +23 -0
  65. package/src/shared/route.ts +18 -4
  66. package/src/shared/rpc.ts +125 -30
  67. package/src/shared/seededDocument.ts +5 -6
  68. package/src/shared/storedValue.ts +32 -0
  69. package/src/shared/webStore.ts +54 -0
  70. package/src/ui/Router.ts +42 -9
  71. package/src/ui/outboxQueue.ts +1 -1
  72. package/src/ui/wire.ts +4 -4
  73. package/src/shared/KEEP_OPENED.ts +0 -7
  74. /package/src/{server → shared}/IMAGE_TYPES.ts +0 -0
package/docs/RULEBOOK.md CHANGED
@@ -383,6 +383,20 @@ producer.
383
383
  7.19 A load over a value `s.invalidate` marked that is refused with `HttpError` at 503 MUST leave the
384
384
  value it held being served.
385
385
 
386
+ 7.20 `poll` MUST refresh the value per 7.4 every `poll` milliseconds from where it is constructed,
387
+ and on a `Keyed` MUST refresh each entry the `Keyed` holds.
388
+
389
+ 7.21 `poll` MUST NOT refresh a value while its `s.busy` is true.
390
+
391
+ 7.22 A `poll` timer MUST NOT hold the process open.
392
+
393
+ 7.23 `poll` MUST stop once the value is released: the setup or request that built it, or its
394
+ `Keyed`, ended.
395
+
396
+ 7.24 `poll` on a value with no producer MUST be inert.
397
+
398
+ 7.25 A `poll` that is not a positive number MUST refuse at construction.
399
+
386
400
  # 8. Stores
387
401
 
388
402
  8.1 A `Store` MUST provide both `get` and `set`.
@@ -400,7 +414,8 @@ miss falls back to.
400
414
 
401
415
  8.7 A restored stream MUST report `s.ready` true and `s.busy` false.
402
416
 
403
- 8.8 A `Store`'s `set` MUST run once per production, per 5.2.
417
+ 8.8 A `Store`'s `set` MUST run once per production, per 5.2, save a restore and the initial value a
418
+ miss falls back to.
404
419
 
405
420
  8.9 A `Store`'s `set` on a streaming producer MUST run once at close, on the accumulation.
406
421
 
@@ -432,6 +447,26 @@ the function it is handed MUST run `get` again as a restore, per 8.18, and MUST
432
447
  8.21 What a `Store`'s `watch` returns MUST be called once the `Reactive` is released: a `Keyed`
433
448
  entry evicted, or the setup or request that built it, or its `Keyed`, ended.
434
449
 
450
+ 8.22 `webStore` MUST keep the value under its key in `localStorage`, or in `sessionStorage` where its
451
+ `area` is `'session'`.
452
+
453
+ 8.23 `webStore` MUST answer every `get` with a miss, and MUST write nothing, where the process has no
454
+ Web Storage.
455
+
456
+ 8.24 `webStore`'s `watch` MUST call what it is handed when another document writes or clears its key
457
+ in its area.
458
+
459
+ 8.25 `sqliteStore` MUST keep the value in one row of its table under its key, and MUST create the
460
+ table where it does not exist.
461
+
462
+ 8.26 `webStore` and `sqliteStore` MUST answer a miss for a value whose `ttl`, as their `set` received
463
+ it, has passed.
464
+
465
+ 8.27 `webStore` and `sqliteStore` MUST run their `schema` on what `get` reads, and MUST throw what it
466
+ refuses, per 8.15.
467
+
468
+ 8.28 `webStore` and `sqliteStore` MUST keep the value as JSON.
469
+
435
470
  # 9. Streams and wired values
436
471
 
437
472
  9.1 A streaming producer's `Stored` MUST be the chunks accumulated so far, materialized on the
@@ -679,9 +714,9 @@ teardown of the scope it was opened in.
679
714
  12.6 A throw from an `Effect` or a `Disposer`, and a read of a failed `Reactive` inside one, MUST
680
715
  reach `onError` as thrown, and MUST warn on `abide:watch` with the trace.
681
716
 
682
- 12.7 In a browser a throw from an `Effect` MUST additionally surface as an uncaught error — re-thrown
683
- to the caller of `watch` from its first run, and reported with `reportError` from a rerun — and
684
- MUST NOT keep any other `Effect` the same turn woke from running.
717
+ 12.7 Where `isServer` is false, a throw from an `Effect` MUST additionally surface as an uncaught
718
+ error — re-thrown to the caller of `watch` from its first run, and reported with `reportError` from
719
+ a rerun — and MUST NOT keep any other `Effect` the same turn woke from running.
685
720
 
686
721
  12.8 An `Effect` that threw MUST stop its `watch`.
687
722
 
@@ -698,13 +733,20 @@ woke have run.
698
733
  12.13 A `watch` registered inside a `{#if}` arm or a `{#for}` row MUST stop when the region
699
734
  holding that arm or row is removed.
700
735
 
701
- 12.14 A `reactive` over a body that is not a stream, built where 12.4, 12.5 or 12.13 would own a
702
- `watch`, MUST stop reading its sources once that owner stops and nothing else reads it, and MUST
703
- answer a later read with what its body computes then.
736
+ 12.14 A `reactive` over a body, built where 12.4, 12.5 or 12.13 would own a `watch`, MUST stop
737
+ reading its sources once that owner stops and nothing else reads it, and MUST answer a later read
738
+ with what its body computes then.
704
739
 
705
740
  12.15 The `Effect` values one turn wakes, a slot's own update among them, MAY run in any order,
706
741
  save where a clause orders them.
707
742
 
743
+ 12.16 A stream released under 12.14 MUST stop its run, and the later read MUST start it once more,
744
+ whether or not the stopped run had closed.
745
+
746
+ 12.17 A `reactive` declared where 12.4, 12.5 and 12.13 would own no `watch` MUST NOT be owned by
747
+ one current where it is first reached, save the instance a request builds of it under 11.67, which
748
+ that request owns.
749
+
708
750
  # 13. Selections
709
751
 
710
752
  13.1 A `Selection` MUST be one `Reactive`, one `Keyed`, one `Rpc`, or a set of `tags`.
@@ -1134,6 +1176,17 @@ a call not yet delivered.
1134
1176
  as a write made here (3.10), and a `GET`'s copy that 16.81 or this settles MUST be loaded again once
1135
1177
  `online` is true.
1136
1178
 
1179
+ 16.86 A refusal a rung may answer with MUST reach `Failures` (16.8) where the rungs are listed at the
1180
+ declaration, and a rung naming no refusal, one typed to answer anything or a `Middleware` whose
1181
+ `Refused` is `Failed<string, unknown>`, MUST add none.
1182
+
1183
+ 16.87 A handler whose parameter carries no annotation MUST take its `Args` from the `args` its options
1184
+ declare.
1185
+
1186
+ 16.88 A handler file's `rpc.address` MUST be its route (23.14) under the mount (16.10) once the file is
1187
+ loaded in a process serving the app's compilation, `bun test`'s under `@abide/abide/test` included
1188
+ (38.109), whether or not `createApp` has run.
1189
+
1137
1190
  # 17. Response helpers
1138
1191
 
1139
1192
  17.1 Every body helper MUST take `Values<T>`.
@@ -1338,6 +1391,8 @@ MUST NOT change that type.
1338
1391
  19.25 `validateJson` MUST read a member left `undefined`, at any depth of a record, as absent to
1339
1392
  `required`, `properties` and `additionalProperties` — in process as the wire carries it (30.28).
1340
1393
 
1394
+ 19.26 An `Issues<T>` over an `Rpc` MUST be the `Issues` of that `Rpc`'s `Args`.
1395
+
1341
1396
  # 20. Generated surfaces
1342
1397
 
1343
1398
  20.1 Every surface `Clients` names MUST be derived from the route table, and MUST NOT be authored
@@ -1481,7 +1536,7 @@ stale-if-error=31536000`.
1481
1536
 
1482
1537
  # 22. Request-scoped ambients
1483
1538
 
1484
- 22.1 `request`, `response` and `server` MUST throw outside a request.
1539
+ 22.1 `request`, `requestIP`, `response` and `server` MUST throw outside a request.
1485
1540
 
1486
1541
  22.2 `cookies` MUST be isomorphic, and on a server writes MUST be collected onto the response.
1487
1542
 
@@ -1505,6 +1560,16 @@ being served.
1505
1560
  a connection to the socket mux, whose headers went out with the upgrade. A caller minted there MUST
1506
1561
  be that scope's alone.
1507
1562
 
1563
+ 22.11 `isServer` MUST be true inside a request, an `App.run` or a `render`, and wherever there is no
1564
+ document, and MUST be false everywhere else.
1565
+
1566
+ 22.12 `requestIP` MUST answer the address of the peer the listener received the request being served
1567
+ from, the same under `abide start`, `abide dev` and `App.listen`, and `null` where the listener names
1568
+ none.
1569
+
1570
+ 22.13 `requestIP` MUST answer `'in-process'` for a request no listener received: one `App.fetch` or
1571
+ `App.run` was handed in process, a call the app makes of itself among them.
1572
+
1508
1573
  # 23. Route and connectivity
1509
1574
 
1510
1575
  23.1 Each member of `route` MUST be its own `Reactive`, and `route` MUST NOT be one `Reactive` over a
@@ -1520,9 +1585,9 @@ composite.
1520
1585
 
1521
1586
  23.6 `route.name` MUST be the resolution path.
1522
1587
 
1523
- 23.7 In a browser `online` MUST be `navigator.onLine` and its events.
1588
+ 23.7 Where `isServer` is false, `online` MUST be `navigator.onLine` and its events.
1524
1589
 
1525
- 23.8 On a server `online` MUST be true.
1590
+ 23.8 Where `isServer` is true, `online` MUST be true.
1526
1591
 
1527
1592
  23.9 In a page or a layout, `route.params()` MUST be typed by that file's own route: a required
1528
1593
  segment as text, an optional one as text that may be absent, a rest as a list, and in a layout any
@@ -1582,6 +1647,13 @@ under, and one naming none MUST be a build error naming the segment's file and `
1582
1647
  23.27 Two routes naming different matchers, or a matcher and none, at one parameter position after
1583
1648
  one static prefix MUST be a build error naming both files.
1584
1649
 
1650
+ 23.28 In a browser `route.index` MUST be 0 at an entry a document load arrived at carrying no index
1651
+ the router wrote, one more than the index of the entry a push or a browser's fragment step left, and
1652
+ the index the entry was written with where a history step or a reload arrives at it — so a step back
1653
+ of no more than `route.index` entries MUST arrive at an entry of this app's router.
1654
+
1655
+ 23.29 On a server `route.index` MUST be 0.
1656
+
1585
1657
  # 24. Tracing
1586
1658
 
1587
1659
  24.1 `trace` MUST be built on first ask and held for the request.
@@ -1868,6 +1940,11 @@ matches it, and a `[...rest]` naming one MUST take a part only where it does.
1868
1940
  30.37 An address whose part a segment refuses, by its matcher or by 30.34, MUST be matched against
1869
1941
  the routes 30.9 ranks after that route.
1870
1942
 
1943
+ 30.38 `navigate` given a number MUST step the history by that many entries, back where it is
1944
+ negative, and MUST settle once the entry the next history step arrives at is arrived at, per 30.29.
1945
+
1946
+ 30.39 `navigate` given 0 MUST settle at once, and MUST NOT reload the document.
1947
+
1871
1948
  # 31. Reading and writing by name
1872
1949
 
1873
1950
  31.1 Inside a `.abide` file a name bound to a `Reactive` MUST be read wherever 31.3 does not hold it.
@@ -1909,8 +1986,8 @@ type parameter constrained by one.
1909
1986
  array or an object whose prototype is `Object.prototype` or `null` — MUST assign on that value itself, MUST NOT
1910
1987
  copy it or any level above it, and MUST NOT wake a reader.
1911
1988
 
1912
- 31.15 `route.url`, `route.params`, `route.name` and `route.navigating` MUST each be read and written
1913
- as a name bound to a `Reactive` is, per 31.1 to 31.7.
1989
+ 31.15 `route.url`, `route.params`, `route.name`, `route.index` and `route.navigating` MUST each be
1990
+ read and written as a name bound to a `Reactive` is, per 31.1 to 31.7.
1914
1991
 
1915
1992
  # 32. Templating
1916
1993
 
@@ -2149,6 +2226,16 @@ build error.
2149
2226
  32.77 A slot holding a value branded by `raw` MUST write its markup as given, with no element or
2150
2227
  attribute in it removed and no URL in it scheme-checked.
2151
2228
 
2229
+ 32.78 `abide check` MUST hold the `set` of a `bind:` on an element to what the element writes back:
2230
+ a boolean for `bind:checked` and `bind:open`, a list of files for `bind:files`, and for a
2231
+ `bind:value` `number | undefined` on an `<input>` whose `type` is `number` or `range`, and otherwise,
2232
+ on an `<input>` or a `<textarea>`, a string where the bound value holds no number,
2233
+ `number | undefined` where it holds nothing else, and all three where it holds both (32.58). A
2234
+ `<select>` MUST be held as an `<input>` is, save that where the bound value holds strings it writes
2235
+ those strings, and a `<select multiple>` a list of the strings its value's items hold, or of any
2236
+ string where they hold none. A `type` or a `multiple` written as an expression, or absent beside a
2237
+ spread, MUST be held to the union of what each value of it writes.
2238
+
2152
2239
  # 33. Props
2153
2240
 
2154
2241
  33.1 `props` MUST be callable from a `<script>` block only, and calling it from a `<script module>`
@@ -2469,6 +2556,47 @@ a 405 for a rung filed at the root route.
2469
2556
  37.15 A `middleware` rung outside one that returned a `Failed` MUST be handed 37.14's answer from
2470
2557
  `next`, and MUST NOT be handed the `Failed`.
2471
2558
 
2559
+ 37.16 An `onError` called in a component's `<script>` MUST be filed in the browser for as long as
2560
+ that component stands, and MUST file nothing where that `<script>` runs for a server's render.
2561
+
2562
+ 37.17 In a browser, a throw nothing caught, a rejection nothing handled and what 12.6 hands
2563
+ `onError` MUST each reach every `onError` 37.16 filed, the last filed first, and once — a throw
2564
+ 12.6 handed MUST NOT be handed again where 12.7 surfaces it.
2565
+
2566
+ 37.18 In a browser, an `onError` that throws MUST be written to `abide:lifecycle`, and MUST NOT keep
2567
+ any other `onError` from being handed the error.
2568
+
2569
+ 37.19 A `middleware` rung MUST be handed as `ctx.lane` the `Lane` that answers the request it is
2570
+ handed, a request a rung handed `next` included: `handler` where a handler answers its method at its
2571
+ address, a private handler and one abide mounts included; `file` a file under a `public` directory;
2572
+ `openapi`, `mcp` and `bridge` that address of abide's own; `socket` the upgrade to the socket mux;
2573
+ `abide` every other address under `/__abide`; and `page` every other address, one nothing answers
2574
+ included.
2575
+
2576
+ 37.20 A `middleware` rung MUST be handed the request addressed below the path `APP_URL` names, as
2577
+ the route table reads it.
2578
+
2579
+ 37.21 An `onError` from `@abide/abide` called anywhere but a component's `<script>` being set up in a
2580
+ browser or rendered by a server — a `<script server>`, a server module, a module's top level, a
2581
+ callback that runs later — MUST throw, naming `@abide/abide/server`'s as the server's.
2582
+
2583
+ 37.22 An `onRefusal` MUST be filed, and MUST file nothing, where 37.16 has an `onError` filed and
2584
+ file nothing.
2585
+
2586
+ 37.23 An `onRefusal` called anywhere 37.21 has an `onError` from `@abide/abide` throw MUST throw.
2587
+
2588
+ 37.24 In a browser, every `Failed` an `Rpc` call is answered with over http — one its handler
2589
+ returned, one anything between the browser and the handler answered with, 16.79's, and one a call
2590
+ `outbox` sends is answered with — MUST reach every `onRefusal` 37.22 filed, the last filed first,
2591
+ and once, handed the call's method and URL beside it.
2592
+
2593
+ 37.25 A call whose `signal` aborted MUST NOT reach `onRefusal`.
2594
+
2595
+ 37.26 In a browser, an `onRefusal` that throws MUST be handled as 37.18 has an `onError` that throws.
2596
+
2597
+ 37.27 An `onRefusal` MUST NOT change the `Failed` the call refuses with, nor keep the call from
2598
+ refusing with it.
2599
+
2472
2600
  # 38. Commands
2473
2601
 
2474
2602
  ## The commands
@@ -2872,6 +3000,18 @@ in its `bunfig.toml` (38.43), and a stylesheet importing `tailwindcss` that its
2872
3000
  38.133 Under `bun test` with `@abide/abide/test` preloaded, each test file after the first in a
2873
3001
  process MUST start as a bare `invalidate` (13.6) leaves the values the files before it loaded.
2874
3002
 
3003
+ 38.134 A prop a test hands a component it binds for `mount` as an own getter MUST be read through
3004
+ that getter on each read the component makes, and any other prop MUST be the value it held when the
3005
+ component was bound.
3006
+
3007
+ 38.135 `abide routes` MUST print beside each handler every rung its declaration's `middleware`
3008
+ names, as written — an entry by the function it calls or the name it refers to, a spread by what it
3009
+ spreads, an inline function as `<inline>`, and a value that is no array as one entry — and MUST say
3010
+ where that declaration's options are not an object written inline.
3011
+
3012
+ 38.136 `abide dev`, `abide start`, the executable's `start` and the app 38.53 serves MUST listen on
3013
+ the interface `--hostname` names alone, and on every interface where it names none.
3014
+
2875
3015
  # 39. Head and view transitions
2876
3016
 
2877
3017
  39.1 A `<head>` element in a `.abide` file MUST contribute its children to the document head.
@@ -3141,8 +3281,8 @@ adopts the page, however early its answer arrived.
3141
3281
  made an `Rpc` call, or whose markup reads a bare `busy` or `ready`, and building that component's
3142
3282
  markup.
3143
3283
 
3144
- 41.29 A `render` answering a request whose `sec-fetch-dest` is `empty` MUST NOT fill the seed buffer,
3145
- save one whose `abide-keep` header names `open`.
3284
+ 41.29 A `render` answering a request whose `sec-fetch-dest` is `empty` and whose `sec-fetch-mode` is not
3285
+ `navigate` MUST NOT fill the seed buffer.
3146
3286
 
3147
3287
  41.30 A `render` answering a request carrying `abide-keep` MUST write 41.20's script.
3148
3288
 
@@ -3203,6 +3343,13 @@ connection still answering, and MUST then run `onStop` without waiting on what i
3203
3343
  `onPrincipal` as a sealed cookie's are, MUST NOT write the principal cookie, and MUST give the scope
3204
3344
  a request where `request` is not given.
3205
3345
 
3346
+ 42.20 A `principal` on `App.fetch` MUST be the claims the request's `principal` resolves from, as
3347
+ 42.19 states for `App.run`, over any principal cookie the request carries.
3348
+
3349
+ 42.21 A `caller` on `App.run` or `App.fetch` MUST be its scope's `principal.caller`, over any caller
3350
+ cookie the request carries, MUST NOT write the caller cookie, and on `App.run` MUST give the scope a
3351
+ request where `request` is not given.
3352
+
3206
3353
  # 43. The measurement harness
3207
3354
 
3208
3355
  43.1 `@abide/harness/measure`, `@abide/harness/engine` and `@abide/harness/server` MUST each be
@@ -3285,7 +3432,8 @@ one JSON row per line as each lands, for the items `inScope` and `matchesFilter`
3285
3432
  runner wrote no report as `broken` rather than as a result.
3286
3433
 
3287
3434
  43.28 The DOM `@abide/harness/preload` registers MUST leave the runtime's own `fetch`, `Request`,
3288
- `Response`, `Headers`, `Blob`, `File`, `FormData`, `AbortController` and `AbortSignal` the globals.
3435
+ `Response`, `Headers`, `Blob`, `File`, `FormData`, `AbortController`, `AbortSignal`, `WebSocket`,
3436
+ `TransformStream` and `WritableStream` the globals.
3289
3437
 
3290
3438
  43.29 `runBenches` MUST run, as one bench each, every function a bench file exports other than
3291
3439
  `CEILINGS`.
@@ -3301,6 +3449,9 @@ naming a bench its file does not export.
3301
3449
 
3302
3450
  43.34 `runBenches` given `only` MUST run only the bench files whose path below `root` holds it.
3303
3451
 
3452
+ 43.35 The DOM `@abide/harness/preload` registers MUST NOT fetch a stylesheet or a script a document
3453
+ it parses names.
3454
+
3304
3455
  # 44. The assistant
3305
3456
 
3306
3457
  44.1 `assistant` MUST answer only through a handler that yields it, and MUST NOT mount an address
@@ -3395,7 +3546,7 @@ before it exits.
3395
3546
  44.31 A conversation MUST write one `debug` line on `abide:assistant` when its events end, naming
3396
3547
  its stop reason, the transcript's length, the tool calls it made, its usage and how long it took,
3397
3548
  and naming it `unfinished` where it ended without a `done`, followed by why — `aborted` where the
3398
- request's signal aborted, else `failed` where its provider threw, with the throw's message ending the
3549
+ signal 44.57 hands its provider aborted, else `failed` where its provider threw, with the throw's message ending the
3399
3550
  line, else `stopped` where its caller stopped reading.
3400
3551
 
3401
3552
  44.32 A command `claudeCode.bridgeCommand` or `claudeCode.bridge` mints with `tools` MUST grant
@@ -3453,6 +3604,36 @@ report that turn failed.
3453
3604
  44.47 A bridge MUST reach `/__abide/bridge` over a certificate that either bun's own authorities or
3454
3605
  the authorities its machine trusts sign, however the bridge was started.
3455
3606
 
3607
+ 44.48 `assistant` MUST carry on each `tool` and `result` `AssistantEvent` of a call to a tool its
3608
+ `Toolbox` lists the `method` and the `address` the called handler's `Rpc` reads, and MUST carry
3609
+ `undefined` for a call to any other tool.
3610
+
3611
+ 44.49 A `result` `AssistantEvent` MUST carry as its `value` its text read as JSON where its call did
3612
+ not fail and its handler has a schema 19.21 derives, and MUST carry `undefined` otherwise.
3613
+
3614
+ 44.50 A `Provider` MUST name the tool of each `tool` event it yields as its `Toolbox` lists it.
3615
+
3616
+ 44.51 `resultsOf` MUST hand back, in order, the `value` of each `result` `AssistantEvent` whose
3617
+ handler is the `Rpc` it is given, and none of a call that failed.
3618
+
3619
+ 44.52 `imagePiece` MUST draw an image longer than 1568 pixels on its long side down to 1568, and an
3620
+ image of a type 44.36 does not name at its own size, and MUST NOT draw a GIF.
3621
+
3622
+ 44.53 An image `imagePiece` draws MUST be a PNG where it was a PNG or a WebP, and a JPEG otherwise.
3623
+
3624
+ 44.54 `imagePiece` MUST hand on as it is an image it does not draw or cannot, and MUST throw where
3625
+ that image is of a type 44.36 does not name.
3626
+
3627
+ 44.55 `imageFiles` MUST hand back, in order, the files a `DataTransfer` carries of a type 44.36
3628
+ names, reading its `items` where its `files` hold none.
3629
+
3630
+ 44.56 The `install` of a pairing `claudeCode.bridgeCommand` or `claudeCode.bridge` mints MUST run
3631
+ `abide-bridge install` at the bridge release its command runs.
3632
+
3633
+ 44.57 `assistant` MUST hand its `Provider` a `limits.signal` that aborts once the request's signal
3634
+ aborts or once the `signal` its caller passed does, and once that signal aborts MUST end the
3635
+ conversation without waiting for the provider to, refused with `aborted` at status 499.
3636
+
3456
3637
  # 45. Offline
3457
3638
 
3458
3639
  45.1 Where `ABIDE_OFFLINE` is on, a page `abide build` built MUST register the worker
@@ -3517,18 +3698,25 @@ and that copy is stale by no more than its `stale-if-error`.
3517
3698
  45.20 The worker `ABIDE_OFFLINE` turns on MUST answer a request that is not a navigation, and whose
3518
3699
  `cache` is `no-cache`, `reload` or `no-store`, with the network's answer alone.
3519
3700
 
3520
- 45.21 The worker `ABIDE_OFFLINE` turns on MUST ask the network past the browser's own cache.
3701
+ 45.21 The worker `ABIDE_OFFLINE` turns on MUST ask the network past the browser's own cache, save
3702
+ for a navigation 45.25 has it ask as itself.
3521
3703
 
3522
3704
  45.22 The worker `ABIDE_OFFLINE` turns on MUST mark an answer it gives from a copy it saved with an
3523
3705
  `abide-kept` header naming that copy's `date`.
3524
3706
 
3525
3707
  45.23 The worker `ABIDE_OFFLINE` turns on MUST ask for a page it saves with an `abide-keep` header,
3526
- naming `open` where its answer is the one a navigation opens.
3708
+ save for a navigation 45.25 has it ask as itself.
3527
3709
 
3528
3710
  45.24 The worker `ABIDE_OFFLINE` turns on MUST save the page of an address a `navigate` reached,
3529
3711
  where it saved no copy of that address 45.19 would answer with, and MUST NOT save one of another
3530
3712
  origin.
3531
3713
 
3714
+ 45.25 The worker `ABIDE_OFFLINE` turns on MUST ask the network for a navigation with the navigation's
3715
+ own request, unchanged.
3716
+
3717
+ 45.26 The worker `ABIDE_OFFLINE` turns on MUST drop the copy it saved of an address where the network
3718
+ answers that address with an answer 45.3 or 45.4 does not let it save, save one of 500 or above.
3719
+
3532
3720
  # 46. Outbox
3533
3721
 
3534
3722
  46.1 `outbox` MUST answer, oldest first, every call queued in it that was neither delivered nor