@shivaedev/contract 0.49.0 → 0.51.0

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 (66) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +160 -123
  3. package/dist/bind.d.ts +7 -0
  4. package/dist/bind.d.ts.map +1 -1
  5. package/dist/bind.js +2 -1
  6. package/dist/bind.js.map +1 -1
  7. package/dist/clientOperations.d.ts +5 -1
  8. package/dist/clientOperations.d.ts.map +1 -1
  9. package/dist/clientOperations.js +4 -0
  10. package/dist/clientOperations.js.map +1 -1
  11. package/dist/commandSignal.d.ts.map +1 -1
  12. package/dist/commandSignal.js +17 -13
  13. package/dist/commandSignal.js.map +1 -1
  14. package/dist/connectionReadiness.js +1 -1
  15. package/dist/connectionReadiness.js.map +1 -1
  16. package/dist/defineModule.d.ts +5 -7
  17. package/dist/defineModule.d.ts.map +1 -1
  18. package/dist/defineModule.js.map +1 -1
  19. package/dist/failureKind.d.ts +10 -0
  20. package/dist/failureKind.d.ts.map +1 -0
  21. package/dist/failureKind.js +20 -0
  22. package/dist/failureKind.js.map +1 -0
  23. package/dist/live.d.ts.map +1 -1
  24. package/dist/live.js +16 -6
  25. package/dist/live.js.map +1 -1
  26. package/dist/liveHintQueue.d.ts.map +1 -1
  27. package/dist/liveHintQueue.js +19 -14
  28. package/dist/liveHintQueue.js.map +1 -1
  29. package/dist/moduleHandlers.d.ts +3 -3
  30. package/dist/moduleHandlers.d.ts.map +1 -1
  31. package/dist/moduleHandlers.js.map +1 -1
  32. package/dist/moduleProof.d.ts +10 -12
  33. package/dist/moduleProof.d.ts.map +1 -1
  34. package/dist/querySubscription.js +5 -1
  35. package/dist/querySubscription.js.map +1 -1
  36. package/dist/reflection.d.ts.map +1 -1
  37. package/dist/reflection.js +3 -3
  38. package/dist/reflection.js.map +1 -1
  39. package/dist/runProof.d.ts +2 -1
  40. package/dist/runProof.d.ts.map +1 -1
  41. package/dist/servedOperation.d.ts.map +1 -1
  42. package/dist/servedOperation.js +2 -1
  43. package/dist/servedOperation.js.map +1 -1
  44. package/dist/socketProtocol.js +1 -1
  45. package/dist/socketProtocol.js.map +1 -1
  46. package/dist/staleWrite.d.ts +10 -0
  47. package/dist/staleWrite.d.ts.map +1 -0
  48. package/dist/staleWrite.js +14 -0
  49. package/dist/staleWrite.js.map +1 -0
  50. package/package.json +9 -9
  51. package/src/bind.ts +9 -9
  52. package/src/clientOperations.ts +4 -0
  53. package/src/commandSignal.ts +16 -12
  54. package/src/connectionReadiness.ts +1 -1
  55. package/src/defineModule.ts +13 -10
  56. package/src/failureKind.ts +33 -0
  57. package/src/live.ts +19 -6
  58. package/src/liveHintQueue.ts +20 -14
  59. package/src/moduleHandlers.ts +3 -3
  60. package/src/moduleProof.ts +15 -23
  61. package/src/querySubscription.ts +7 -1
  62. package/src/reflection.ts +88 -86
  63. package/src/runProof.ts +3 -1
  64. package/src/servedOperation.ts +2 -1
  65. package/src/socketProtocol.ts +1 -1
  66. package/src/staleWrite.ts +23 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.51.0 - 2026-11-20
4
+
5
+ ### Added
6
+
7
+ - a stale versioned write that reaches the end of an operation's `run` answers the caller with the shared `Conflict` from `@shivaedev/errors/taxonomy.ts`, whose message tells the person to refresh and try again. The generated wire lists `Conflict` for that operation, so its client sees a typed rejection and the default notice shows the message.
8
+
9
+ ### Breaking
10
+
11
+ - an operation's `run` now fails with `Conflict` where its body lets an `OptimisticConcurrencyError` from an `@shivaedev/sql` repository through, so code that calls `Operation.run` and catches `OptimisticConcurrencyError` after it catches `Conflict` instead. Delete each `Effect.catchTag("OptimisticConcurrencyError", …)` in `run` that only returned a `Conflict`; keep one that answers something else.
12
+
13
+ ## 0.50.0 - 2026-11-20
14
+
15
+ ### Added
16
+
17
+ - `failureKind(error)` in `failureKind.ts` returns `"request"`, `"framework"` or `"app"`, with the `FrameworkFailure` and `AppRejection<E>` types and the `isFrameworkFailure` guard.
18
+ - a bound command carries `runtime`, the atom runtime of its client, and `payload`, its declared payload schema. Bound queries and streams carry `runtime` too.
19
+
20
+ ### Breaking
21
+
22
+ - `defineModule` no longer takes `requires`: delete the `requires` line from every `defineModule({ ... })`, and the imports only it used. The module's type now carries, for each operation, the services its `run` and read policy yield, less what its middleware and subject provide per call, and `moduleHandlers(module)` requires exactly those services. An operation that starts to yield another service needs no other edit.
23
+ - `OperationNeedsUndeclaredServices` and `Allowed` are removed from `@shivaedev/contract/moduleProof.ts`, and `NameProof` takes the operations and the wire only. A module's `"~requires"` is now a record from each operation's name to the services it needs, and `AnyModule["~requires"]` is `ModuleServices`.
24
+
3
25
  ## 0.49.0 - 2026-11-20
4
26
 
5
27
  ### Added