foldkit-remote 0.20.0 → 0.22.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 (198) hide show
  1. package/README.md +987 -198
  2. package/dist/answerGaps.d.ts +16 -0
  3. package/dist/answerGaps.d.ts.map +1 -0
  4. package/dist/answerGaps.js +60 -0
  5. package/dist/answerGaps.js.map +1 -0
  6. package/dist/client-B055kQuP.d.ts +110 -0
  7. package/dist/client-B055kQuP.d.ts.map +1 -0
  8. package/dist/client.d.ts +2 -0
  9. package/dist/client.js +142 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/coalesce-CLAr92Nk.d.ts +34 -0
  12. package/dist/coalesce-CLAr92Nk.d.ts.map +1 -0
  13. package/dist/coalesce.d.ts +2 -0
  14. package/dist/coalesce.js +131 -0
  15. package/dist/coalesce.js.map +1 -0
  16. package/dist/connection-BRyaJy89.d.ts +45 -0
  17. package/dist/connection-BRyaJy89.d.ts.map +1 -0
  18. package/dist/connection.d.ts +2 -0
  19. package/dist/connection.js +170 -0
  20. package/dist/connection.js.map +1 -0
  21. package/dist/data.d.ts +7 -0
  22. package/dist/data.d.ts.map +1 -0
  23. package/dist/data.js +21 -0
  24. package/dist/data.js.map +1 -0
  25. package/dist/diagnostics-DHhVYflV.d.ts +125 -0
  26. package/dist/diagnostics-DHhVYflV.d.ts.map +1 -0
  27. package/dist/diagnostics.d.ts +2 -0
  28. package/dist/diagnostics.js +60 -0
  29. package/dist/diagnostics.js.map +1 -0
  30. package/dist/entity-CgsG5Uel.d.ts +196 -0
  31. package/dist/entity-CgsG5Uel.d.ts.map +1 -0
  32. package/dist/entity-DuDxaa3n.js +279 -0
  33. package/dist/entity-DuDxaa3n.js.map +1 -0
  34. package/dist/entity.d.ts +2 -0
  35. package/dist/entity.js +1 -0
  36. package/dist/held.d.ts +19 -0
  37. package/dist/held.d.ts.map +1 -0
  38. package/dist/held.js +70 -0
  39. package/dist/held.js.map +1 -0
  40. package/dist/impact.d.ts +79 -0
  41. package/dist/impact.d.ts.map +1 -0
  42. package/dist/impact.js +166 -0
  43. package/dist/impact.js.map +1 -0
  44. package/dist/index.d.ts +1542 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +2791 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/inspect-DtRQGCRP.d.ts +134 -0
  49. package/dist/inspect-DtRQGCRP.d.ts.map +1 -0
  50. package/dist/inspect.d.ts +2 -0
  51. package/dist/inspect.js +33 -0
  52. package/dist/inspect.js.map +1 -0
  53. package/dist/json-DowLl1eB.d.ts +52 -0
  54. package/dist/json-DowLl1eB.d.ts.map +1 -0
  55. package/dist/json.d.ts +2 -0
  56. package/dist/json.js +123 -0
  57. package/dist/json.js.map +1 -0
  58. package/dist/law.d.ts +56 -0
  59. package/dist/law.d.ts.map +1 -0
  60. package/dist/law.js +201 -0
  61. package/dist/law.js.map +1 -0
  62. package/dist/live-BpTzlCnY.d.ts +79 -0
  63. package/dist/live-BpTzlCnY.d.ts.map +1 -0
  64. package/dist/live.d.ts +2 -0
  65. package/dist/live.js +126 -0
  66. package/dist/live.js.map +1 -0
  67. package/dist/matching-DF5F9Us8.d.ts +100 -0
  68. package/dist/matching-DF5F9Us8.d.ts.map +1 -0
  69. package/dist/matching.d.ts +2 -0
  70. package/dist/matching.js +172 -0
  71. package/dist/matching.js.map +1 -0
  72. package/dist/model-B6zk1NMB.d.ts +710 -0
  73. package/dist/model-B6zk1NMB.d.ts.map +1 -0
  74. package/dist/model.d.ts +2 -0
  75. package/dist/model.js +1308 -0
  76. package/dist/model.js.map +1 -0
  77. package/dist/mutation.d.ts +2 -0
  78. package/dist/mutation.js +612 -0
  79. package/dist/mutation.js.map +1 -0
  80. package/dist/optimistic-CECsfNGY.d.ts +523 -0
  81. package/dist/optimistic-CECsfNGY.d.ts.map +1 -0
  82. package/dist/optimistic.d.ts +2 -0
  83. package/dist/optimistic.js +336 -0
  84. package/dist/optimistic.js.map +1 -0
  85. package/dist/outbox-DNuc4kZp.d.ts +259 -0
  86. package/dist/outbox-DNuc4kZp.d.ts.map +1 -0
  87. package/dist/outbox.d.ts +2 -0
  88. package/dist/outbox.js +326 -0
  89. package/dist/outbox.js.map +1 -0
  90. package/dist/patchValues.d.ts +10 -0
  91. package/dist/patchValues.d.ts.map +1 -0
  92. package/dist/patchValues.js +57 -0
  93. package/dist/patchValues.js.map +1 -0
  94. package/dist/persistence-CCMnvg7-.d.ts +114 -0
  95. package/dist/persistence-CCMnvg7-.d.ts.map +1 -0
  96. package/dist/persistence.d.ts +2 -0
  97. package/dist/persistence.js +205 -0
  98. package/dist/persistence.js.map +1 -0
  99. package/dist/placement-jZdsIpmj.d.ts +50 -0
  100. package/dist/placement-jZdsIpmj.d.ts.map +1 -0
  101. package/dist/placement.d.ts +2 -0
  102. package/dist/placement.js +116 -0
  103. package/dist/placement.js.map +1 -0
  104. package/dist/plan-D9cftxC_.d.ts +35 -0
  105. package/dist/plan-D9cftxC_.d.ts.map +1 -0
  106. package/dist/plan.d.ts +2 -0
  107. package/dist/plan.js +100 -0
  108. package/dist/plan.js.map +1 -0
  109. package/dist/policy-DsWHmIAq.d.ts +42 -0
  110. package/dist/policy-DsWHmIAq.d.ts.map +1 -0
  111. package/dist/policy.d.ts +2 -0
  112. package/dist/policy.js +32 -0
  113. package/dist/policy.js.map +1 -0
  114. package/dist/{port.d.mts → port.d.ts} +3 -2
  115. package/dist/port.d.ts.map +1 -0
  116. package/dist/{port.mjs → port.js} +3 -2
  117. package/dist/port.js.map +1 -0
  118. package/dist/query-BuIU93xA.d.ts +141 -0
  119. package/dist/query-BuIU93xA.d.ts.map +1 -0
  120. package/dist/query.d.ts +2 -0
  121. package/dist/query.js +0 -0
  122. package/dist/query.js.map +1 -0
  123. package/dist/record.d.ts +11 -0
  124. package/dist/record.d.ts.map +1 -0
  125. package/dist/record.js +21 -0
  126. package/dist/record.js.map +1 -0
  127. package/dist/relation-BLBGOZom.d.ts +59 -0
  128. package/dist/relation-BLBGOZom.d.ts.map +1 -0
  129. package/dist/relation.d.ts +2 -0
  130. package/dist/relation.js +93 -0
  131. package/dist/relation.js.map +1 -0
  132. package/dist/remoteData-mK1suYi1.d.ts +148 -0
  133. package/dist/remoteData-mK1suYi1.d.ts.map +1 -0
  134. package/dist/remoteData.d.ts +2 -0
  135. package/dist/remoteData.js +179 -0
  136. package/dist/remoteData.js.map +1 -0
  137. package/dist/reporting.d.ts +12 -0
  138. package/dist/reporting.d.ts.map +1 -0
  139. package/dist/reporting.js +45 -0
  140. package/dist/reporting.js.map +1 -0
  141. package/dist/requirement-D57S2LpH.d.ts +64 -0
  142. package/dist/requirement-D57S2LpH.d.ts.map +1 -0
  143. package/dist/requirement.d.ts +2 -0
  144. package/dist/requirement.js +114 -0
  145. package/dist/requirement.js.map +1 -0
  146. package/dist/resume-Ct5R6yli.d.ts +92 -0
  147. package/dist/resume-Ct5R6yli.d.ts.map +1 -0
  148. package/dist/resume.d.ts +2 -0
  149. package/dist/resume.js +222 -0
  150. package/dist/resume.js.map +1 -0
  151. package/dist/retain-BfNTvBRb.d.ts +48 -0
  152. package/dist/retain-BfNTvBRb.d.ts.map +1 -0
  153. package/dist/retain.d.ts +2 -0
  154. package/dist/retain.js +107 -0
  155. package/dist/retain.js.map +1 -0
  156. package/dist/selection.d.ts +2 -0
  157. package/dist/selection.js +1 -0
  158. package/dist/shown.d.ts +20 -0
  159. package/dist/shown.d.ts.map +1 -0
  160. package/dist/shown.js +40 -0
  161. package/dist/shown.js.map +1 -0
  162. package/dist/sse-C7LhdbiQ.d.ts +17 -0
  163. package/dist/sse-C7LhdbiQ.d.ts.map +1 -0
  164. package/dist/sse.d.ts +2 -0
  165. package/dist/sse.js +127 -0
  166. package/dist/sse.js.map +1 -0
  167. package/dist/store-ah2qjcJW.d.ts +100 -0
  168. package/dist/store-ah2qjcJW.d.ts.map +1 -0
  169. package/dist/store.d.ts +2 -0
  170. package/dist/store.js +218 -0
  171. package/dist/store.js.map +1 -0
  172. package/dist/testing.d.ts +133 -0
  173. package/dist/testing.d.ts.map +1 -0
  174. package/dist/testing.js +0 -0
  175. package/dist/testing.js.map +1 -0
  176. package/dist/why-kgp_Wr3z.d.ts +483 -0
  177. package/dist/why-kgp_Wr3z.d.ts.map +1 -0
  178. package/dist/why.d.ts +2 -0
  179. package/dist/why.js +293 -0
  180. package/dist/why.js.map +1 -0
  181. package/dist/whyReasons.d.ts +42 -0
  182. package/dist/whyReasons.d.ts.map +1 -0
  183. package/dist/whyReasons.js +211 -0
  184. package/dist/whyReasons.js.map +1 -0
  185. package/dist/wire-DthPcTM6.d.ts +787 -0
  186. package/dist/wire-DthPcTM6.d.ts.map +1 -0
  187. package/dist/wire.d.ts +2 -0
  188. package/dist/wire.js +329 -0
  189. package/dist/wire.js.map +1 -0
  190. package/package.json +19 -14
  191. package/dist/index-BEvVAL76.d.mts +0 -4097
  192. package/dist/index-BEvVAL76.d.mts.map +0 -1
  193. package/dist/index.d.mts +0 -2
  194. package/dist/index.mjs +0 -1
  195. package/dist/port.d.mts.map +0 -1
  196. package/dist/port.mjs.map +0 -1
  197. package/dist/src-BDqn7Ocr.mjs +0 -6344
  198. package/dist/src-BDqn7Ocr.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-DthPcTM6.d.ts","names":[],"sources":["../src/wire.ts"],"mappings":";;;;;;;;cAca;;;;cAEA,wBAAwB;;;;;;cAIxB,4BAA4B;;;;;;;;;;cAe5B,0BAA0B;;;;;;;;;;cAS1B,wBAAwB;;;;;;;;;;;cAWxB,8BAA8B;;;;cAQ9B,wBAAwB;;;;;;;;;cASxB,0BAA0B;;;;;;;cAM1B,4BAA4B;;cAM5B,UAAQ,OAAA;cAER,cAAY,OAAA;;;;;;;cAQZ;;cAEA;cAwBA,iBAAe,OAAA,MAAA,qBAAA;cAEf,aAAa,OAAO,MAAM,aAAa;cAUvC,WAAS,OAAA;;;;cAKT,kBAAgB,OAAA;;;;;;;;;;cAWhB,eAAa,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA8C,OAAA,uBAAA,wBAAA,4BAAA"}
package/dist/wire.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { A as RemoteMutationError, B as WireBoundary, C as ReadBatch, D as RemoteForbidden, E as RelationRequest, F as RemoteUnauthenticated, I as RemoteUnreachable, L as SettledFields, M as RemoteQueryError, N as RemoteReadError, O as RemoteLiveError, P as RemoteRpc, R as ShownSlice, S as Read, T as ReadRequest, _ as QueryEdge, a as LiveEdge, b as QueryRpc, c as MAX_LIVE_QUERIES, d as Mutate, f as MutationRequest, g as PageSize, h as OperationId, i as LiveChange, j as RemoteProtocolError, k as RemoteLiveRefused, l as MAX_RELATION_DEPTH, m as NormalizedEntity, n as ConnectionChangeSchema, o as LiveRequirement, p as MutationResult, r as Live, s as MAX_FIELDS_PER_REQUEST, t as AnswerRead, u as MAX_SHOWN_ENTITIES, v as QueryRequest, w as ReadBatchResult, x as REMOTE_PROTOCOL_VERSION, y as QueryResult, z as WindowSchema } from "./wire-DthPcTM6.js";
2
+ export { AnswerRead, ConnectionChangeSchema, Live, LiveChange, LiveEdge, LiveRequirement, MAX_FIELDS_PER_REQUEST, MAX_LIVE_QUERIES, MAX_RELATION_DEPTH, MAX_SHOWN_ENTITIES, Mutate, MutationRequest, MutationResult, NormalizedEntity, OperationId, PageSize, QueryEdge, QueryRequest, QueryResult, QueryRpc, REMOTE_PROTOCOL_VERSION, Read, ReadBatch, ReadBatchResult, ReadRequest, RelationRequest, RemoteForbidden, RemoteLiveError, RemoteLiveRefused, RemoteMutationError, RemoteProtocolError, RemoteQueryError, RemoteReadError, RemoteRpc, RemoteUnauthenticated, RemoteUnreachable, SettledFields, ShownSlice, WindowSchema, WireBoundary };
package/dist/wire.js ADDED
@@ -0,0 +1,329 @@
1
+ import { Schema } from "effect";
2
+ import { Rpc, RpcGroup } from "effect/rpc";
3
+ // src/wire.ts
4
+ /**
5
+ * The Remote wire: Effect RPC semantics over `effect/rpc`. Remote owns
6
+ * the message shapes; Effect owns the transport. `Make`ing reads batch, mutations
7
+ * preserve order, and live data is a stream.
8
+ */
9
+ /**
10
+ * The read/live protocol version. A batch names the version it speaks and the
11
+ * server refuses a mismatch with `RemoteProtocolError`, so a shape change never
12
+ * drifts silently: bump it whenever `ReadRequest` or `LiveRequirement` change.
13
+ */
14
+ const REMOTE_PROTOCOL_VERSION = 5;
15
+ var RemoteReadError = class extends Schema.TaggedError()("RemoteReadError", { message: Schema.String }) {};
16
+ var RemoteMutationError = class extends Schema.TaggedError()("RemoteMutationError", {
17
+ message: Schema.String,
18
+ /** The mutation's own `Refusal`, encoded, when the server refused it as one. */
19
+ refusal: Schema.optional(Schema.Unknown)
20
+ }) {};
21
+ /**
22
+ * No answer came back: the request could not be sent, or what came back was
23
+ * not an answer. The server may or may not have run it, so it is safe to send
24
+ * again only as the same operation, which a ledgered writer answers from its
25
+ * record. The outbox sends a durable write again after it (#247).
26
+ */
27
+ var RemoteUnreachable = class extends Schema.TaggedError()("Unreachable", { message: Schema.String }) {};
28
+ /**
29
+ * The server refused who is asking: they may not do this, and asking again
30
+ * as the same principal is refused again. `reason` is the application's own
31
+ * words for the person who asked; without it the refusal says nothing of why.
32
+ */
33
+ var RemoteForbidden = class extends Schema.TaggedError()("Forbidden", {
34
+ message: Schema.String,
35
+ reason: Schema.optional(Schema.String)
36
+ }) {};
37
+ /**
38
+ * The server could not tell who is asking: a credential was sent and no
39
+ * longer holds, or none was sent where one is needed. Asking again as the
40
+ * same caller is refused again; signing in again is the remedy. `reason` is
41
+ * words for the person who asked; without it the refusal says nothing of why.
42
+ */
43
+ var RemoteUnauthenticated = class extends Schema.TaggedError()("Unauthenticated", {
44
+ message: Schema.String,
45
+ reason: Schema.optional(Schema.String)
46
+ }) {};
47
+ var RemoteLiveError = class extends Schema.TaggedError()("RemoteLiveError", { message: Schema.String }) {};
48
+ /**
49
+ * The server refused a live subscription for what it asks (more ids of one
50
+ * Entity than `maxIdsPerEntity`), before reading anything. The same
51
+ * requirements are refused again, so a client does not reconnect it.
52
+ */
53
+ var RemoteLiveRefused = class extends Schema.TaggedError()("RemoteLiveRefused", { message: Schema.String }) {};
54
+ /** The peer speaks another protocol version; nothing was read. */
55
+ var RemoteProtocolError = class extends Schema.TaggedError()("RemoteProtocolError", {
56
+ message: Schema.String,
57
+ expected: Schema.Number,
58
+ received: Schema.Number
59
+ }) {};
60
+ /** A page size: a non-negative integer, refused at decode otherwise rather than defaulted. */
61
+ const PageSize = Schema.Number.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0));
62
+ const WindowSchema = Schema.Struct({
63
+ first: Schema.optional(PageSize),
64
+ last: Schema.optional(PageSize),
65
+ after: Schema.optional(Schema.String),
66
+ before: Schema.optional(Schema.String)
67
+ });
68
+ /** A request may not name more fields of one entity than this; a selection never does. */
69
+ const MAX_FIELDS_PER_REQUEST = 256;
70
+ /** A selection may not nest relations deeper than this; the wire refuses more. */
71
+ const MAX_RELATION_DEPTH = 8;
72
+ const Fields = Schema.Array(Schema.String).check(Schema.isMaxLength(256));
73
+ /**
74
+ * The slice required of a relation's target; the ids come from the parent's
75
+ * refs. Built as `MAX_RELATION_DEPTH` nested structs rather than a recursive
76
+ * schema, so a deeper selection is refused at decode with a schema error.
77
+ */
78
+ const relationLevel = (depth) => {
79
+ const slice = {
80
+ entity: Schema.String,
81
+ fields: Fields,
82
+ windows: Schema.optional(Schema.Record(Schema.String, WindowSchema))
83
+ };
84
+ return depth === 0 ? Schema.Struct({
85
+ ...slice,
86
+ relations: Schema.optionalKey(Schema.Never)
87
+ }) : Schema.Struct({
88
+ ...slice,
89
+ relations: Schema.optional(Schema.Record(Schema.String, relationLevel(depth - 1)))
90
+ });
91
+ };
92
+ const RelationRequest = relationLevel(7);
93
+ const ReadRequest = Schema.Struct({
94
+ entity: Schema.String,
95
+ id: Schema.String,
96
+ fields: Fields,
97
+ /** Pagination window per relation field. */
98
+ windows: Schema.optional(Schema.Record(Schema.String, WindowSchema)),
99
+ /** The slice required of each relation field's target, resolved in the same read. */
100
+ relations: Schema.optional(Schema.Record(Schema.String, RelationRequest))
101
+ });
102
+ const ReadBatch = Schema.Struct({
103
+ version: Schema.Number,
104
+ requests: Schema.Array(ReadRequest)
105
+ });
106
+ const NormalizedEntity = Schema.Struct({
107
+ entity: Schema.String,
108
+ id: Schema.String,
109
+ values: Schema.Record(Schema.String, Schema.Unknown)
110
+ });
111
+ /**
112
+ * Fields a read asked for that the server answered without, and will not
113
+ * answer with: the client stops asking. It says nothing about why, so a rule
114
+ * that withholds a field is not itself on the wire.
115
+ */
116
+ const SettledFields = Schema.Struct({
117
+ entity: Schema.String,
118
+ id: Schema.String,
119
+ fields: Schema.Array(Schema.String)
120
+ });
121
+ const ReadBatchResult = Schema.Struct({
122
+ entities: Schema.Array(NormalizedEntity),
123
+ settled: Schema.Array(SettledFields)
124
+ });
125
+ /** A read a mutation's answer carries: what was asked, and what came back. */
126
+ const AnswerRead = Schema.Struct({
127
+ requests: Schema.Array(ReadRequest),
128
+ result: ReadBatchResult
129
+ });
130
+ /**
131
+ * One operation's identity across every client: minted where it is first sent
132
+ * and sent again with each retry of it. Bounded, since a server keys a record
133
+ * of the write by it.
134
+ */
135
+ const OperationId = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(128), Schema.isPattern(/^[A-Za-z0-9:._-]+$/));
136
+ /** A mutation request may name at most this many entities in `shown`. */
137
+ const MAX_SHOWN_ENTITIES = 256;
138
+ /**
139
+ * What a client reads of one entity's rows: a read request without its id. It
140
+ * nests as deep as a read request does, so any slice a read asks can be sent.
141
+ */
142
+ const ShownSlice = Schema.Struct({
143
+ entity: Schema.String,
144
+ fields: Fields,
145
+ windows: Schema.optional(Schema.Record(Schema.String, WindowSchema)),
146
+ relations: Schema.optional(Schema.Record(Schema.String, RelationRequest))
147
+ });
148
+ const MutationRequest = Schema.Struct({
149
+ /**
150
+ * This client's id for the request, the same on each retry of it. It is
151
+ * unique within one client's Model only (a counter there), so it names a
152
+ * request to that client; `operation` names it to a server.
153
+ */
154
+ requestId: Schema.String,
155
+ /** The operation's identity across clients: what a server keys a record of the write by. */
156
+ operation: Schema.optional(OperationId),
157
+ mutation: Schema.String,
158
+ input: Schema.Unknown,
159
+ /** For a mutation that is a `Write`: the input keys to write, when not all of them. */
160
+ keys: Schema.optional(Schema.Array(Schema.String)),
161
+ /**
162
+ * When the reader acted, in milliseconds since the epoch: what the client
163
+ * predicted the write's time as. A server takes it within its `clockSkew`
164
+ * of its own clock. Optional, so a client and a server of either age agree.
165
+ */
166
+ now: Schema.optional(Schema.Int),
167
+ /**
168
+ * What the client's active reads show of each entity's rows. The server
169
+ * answers, of each row the mutation names, the shown fields its answer
170
+ * left out, read as any read is (`MutationResult.read`).
171
+ */
172
+ shown: Schema.optional(Schema.Array(ShownSlice).check(Schema.isMaxLength(256)))
173
+ });
174
+ const LiveEdge = Schema.Struct({
175
+ entity: Schema.String,
176
+ id: Schema.String,
177
+ key: Schema.String
178
+ });
179
+ /** A connection change a mutation confirms: the same facts a live event carries, without a cursor. */
180
+ const ConnectionChangeSchema = Schema.Union([Schema.Struct({
181
+ _tag: Schema.Literal("Insert"),
182
+ connection: Schema.String,
183
+ position: Schema.Union([Schema.Literal("prepend"), Schema.Literal("append")]),
184
+ edge: LiveEdge
185
+ }), Schema.Struct({
186
+ _tag: Schema.Literal("Remove"),
187
+ connection: Schema.String,
188
+ edge: LiveEdge
189
+ })]);
190
+ const MutationResult = Schema.Struct({
191
+ output: Schema.Unknown,
192
+ entities: Schema.Array(NormalizedEntity),
193
+ /** Connection changes the mutation made, applied alongside its entity patches. */
194
+ connections: Schema.optional(Schema.Array(ConnectionChangeSchema)),
195
+ /** Entities the mutation deleted; the client knows them absent from then on. */
196
+ deleted: Schema.optional(Schema.Array(Schema.Struct({
197
+ entity: Schema.String,
198
+ id: Schema.String
199
+ }))),
200
+ /**
201
+ * A fresh read, after the write, of what the request's `shown` asks of the
202
+ * rows the answer names: the requirements read and what came back, written
203
+ * as a read is.
204
+ */
205
+ read: Schema.optional(AnswerRead)
206
+ });
207
+ const QueryRequest = Schema.Struct({
208
+ query: Schema.String,
209
+ input: Schema.Unknown,
210
+ window: WindowSchema,
211
+ /**
212
+ * What to read of each item, as the relation slice a read asks the server
213
+ * for. Absent for a query run without one: the response carries only edges,
214
+ * and the client's read entry fetches fields in a second round trip.
215
+ */
216
+ select: Schema.optional(RelationRequest)
217
+ });
218
+ /** A live subscription may watch no more lists than this; each is run again every tick. */
219
+ const MAX_LIVE_QUERIES = 32;
220
+ const LiveRequirement = Schema.Struct({
221
+ version: Schema.Number,
222
+ requirements: Schema.Array(ReadRequest),
223
+ /** Lists read live (`Data.query(…, { live: true })`), each as its read sends it. */
224
+ queries: Schema.optional(Schema.Array(QueryRequest).check(Schema.isMaxLength(32))),
225
+ /** Resume cursor; events at or before it are duplicates. */
226
+ after: Schema.Number
227
+ });
228
+ /**
229
+ * A live change. Entity changes update the store; connection changes alter
230
+ * membership and ordering; both carry a per-stream cursor.
231
+ */
232
+ const LiveChange = Schema.Union([
233
+ Schema.Struct({
234
+ _tag: Schema.Literal("EntityPatched"),
235
+ cursor: Schema.Number,
236
+ entity: Schema.String,
237
+ id: Schema.String,
238
+ values: Schema.Record(Schema.String, Schema.Unknown),
239
+ changed: Schema.Array(Schema.String)
240
+ }),
241
+ Schema.Struct({
242
+ _tag: Schema.Literal("EntityDeleted"),
243
+ cursor: Schema.Number,
244
+ entity: Schema.String,
245
+ id: Schema.String
246
+ }),
247
+ Schema.Struct({
248
+ _tag: Schema.Literal("ConnectionInsert"),
249
+ cursor: Schema.Number,
250
+ connection: Schema.String,
251
+ position: Schema.Union([Schema.Literal("prepend"), Schema.Literal("append")]),
252
+ edge: LiveEdge
253
+ }),
254
+ Schema.Struct({
255
+ _tag: Schema.Literal("ConnectionRemove"),
256
+ cursor: Schema.Number,
257
+ connection: Schema.String,
258
+ edge: LiveEdge
259
+ }),
260
+ Schema.Struct({
261
+ _tag: Schema.Literal("ConnectionInvalidate"),
262
+ cursor: Schema.Number,
263
+ connection: Schema.String
264
+ })
265
+ ]);
266
+ const Read = Rpc.make("FoldkitRemoteRead", {
267
+ payload: ReadBatch,
268
+ success: ReadBatchResult,
269
+ error: Schema.Union([
270
+ RemoteReadError,
271
+ RemoteProtocolError,
272
+ RemoteUnauthenticated
273
+ ])
274
+ });
275
+ const Mutate = Rpc.make("FoldkitRemoteMutate", {
276
+ payload: MutationRequest,
277
+ success: MutationResult,
278
+ error: Schema.Union([
279
+ RemoteMutationError,
280
+ RemoteForbidden,
281
+ RemoteUnauthenticated
282
+ ])
283
+ });
284
+ const Live = Rpc.make("FoldkitRemoteLive", {
285
+ payload: LiveRequirement,
286
+ success: LiveChange,
287
+ error: Schema.Union([
288
+ RemoteLiveError,
289
+ RemoteLiveRefused,
290
+ RemoteProtocolError,
291
+ RemoteUnauthenticated
292
+ ]),
293
+ stream: true
294
+ });
295
+ var RemoteQueryError = class extends Schema.TaggedError()("RemoteQueryError", { message: Schema.String }) {};
296
+ const WireBoundary = Schema.Union([
297
+ Schema.Struct({ _tag: Schema.Literal("Terminal") }),
298
+ Schema.Struct({
299
+ _tag: Schema.Literal("Cursor"),
300
+ cursor: Schema.String
301
+ }),
302
+ Schema.Struct({ _tag: Schema.Literal("Unknown") })
303
+ ]);
304
+ const QueryEdge = Schema.Struct({
305
+ entity: Schema.String,
306
+ id: Schema.String,
307
+ key: Schema.String
308
+ });
309
+ const QueryResult = Schema.Struct({
310
+ edges: Schema.Array(QueryEdge),
311
+ start: WireBoundary,
312
+ end: WireBoundary,
313
+ /**
314
+ * The selected fields of the page's items, in the same shape a read batch
315
+ * returns. Absent from a server that predates payload planning: the client
316
+ * reads it as empty and fetches fields as before.
317
+ */
318
+ entities: Schema.optional(Schema.Array(NormalizedEntity)),
319
+ settled: Schema.optional(Schema.Array(SettledFields))
320
+ });
321
+ const QueryRpc = Rpc.make("FoldkitRemoteQuery", {
322
+ payload: QueryRequest,
323
+ success: QueryResult,
324
+ error: Schema.Union([RemoteQueryError, RemoteUnauthenticated])
325
+ });
326
+ const RemoteRpc = RpcGroup.make(Read, Mutate, QueryRpc, Live);
327
+ export { AnswerRead, ConnectionChangeSchema, Live, LiveChange, LiveEdge, LiveRequirement, MAX_FIELDS_PER_REQUEST, MAX_LIVE_QUERIES, MAX_RELATION_DEPTH, MAX_SHOWN_ENTITIES, Mutate, MutationRequest, MutationResult, NormalizedEntity, OperationId, PageSize, QueryEdge, QueryRequest, QueryResult, QueryRpc, REMOTE_PROTOCOL_VERSION, Read, ReadBatch, ReadBatchResult, ReadRequest, RelationRequest, RemoteForbidden, RemoteLiveError, RemoteLiveRefused, RemoteMutationError, RemoteProtocolError, RemoteQueryError, RemoteReadError, RemoteRpc, RemoteUnauthenticated, RemoteUnreachable, SettledFields, ShownSlice, WindowSchema, WireBoundary };
328
+
329
+ //# sourceMappingURL=wire.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire.js","names":[],"sources":["../src/wire.ts"],"sourcesContent":["/**\n * The Remote wire: Effect RPC semantics over `effect/rpc`. Remote owns\n * the message shapes; Effect owns the transport. `Make`ing reads batch, mutations\n * preserve order, and live data is a stream.\n */\nimport { Schema } from 'effect'\nimport { Rpc, RpcGroup } from 'effect/rpc'\nimport type { RelationRequirement, Requirement } from './requirement.js'\n\n/**\n * The read/live protocol version. A batch names the version it speaks and the\n * server refuses a mismatch with `RemoteProtocolError`, so a shape change never\n * drifts silently: bump it whenever `ReadRequest` or `LiveRequirement` change.\n */\nexport const REMOTE_PROTOCOL_VERSION = 5\n\nexport class RemoteReadError extends Schema.TaggedError<RemoteReadError>()('RemoteReadError', {\n message: Schema.String,\n}) {}\n\nexport class RemoteMutationError extends Schema.TaggedError<RemoteMutationError>()(\n 'RemoteMutationError',\n {\n message: Schema.String,\n /** The mutation's own `Refusal`, encoded, when the server refused it as one. */\n refusal: Schema.optional(Schema.Unknown),\n },\n) {}\n\n/**\n * No answer came back: the request could not be sent, or what came back was\n * not an answer. The server may or may not have run it, so it is safe to send\n * again only as the same operation, which a ledgered writer answers from its\n * record. The outbox sends a durable write again after it (#247).\n */\nexport class RemoteUnreachable extends Schema.TaggedError<RemoteUnreachable>()('Unreachable', {\n message: Schema.String,\n}) {}\n\n/**\n * The server refused who is asking: they may not do this, and asking again\n * as the same principal is refused again. `reason` is the application's own\n * words for the person who asked; without it the refusal says nothing of why.\n */\nexport class RemoteForbidden extends Schema.TaggedError<RemoteForbidden>()('Forbidden', {\n message: Schema.String,\n reason: Schema.optional(Schema.String),\n}) {}\n\n/**\n * The server could not tell who is asking: a credential was sent and no\n * longer holds, or none was sent where one is needed. Asking again as the\n * same caller is refused again; signing in again is the remedy. `reason` is\n * words for the person who asked; without it the refusal says nothing of why.\n */\nexport class RemoteUnauthenticated extends Schema.TaggedError<RemoteUnauthenticated>()(\n 'Unauthenticated',\n {\n message: Schema.String,\n reason: Schema.optional(Schema.String),\n },\n) {}\n\nexport class RemoteLiveError extends Schema.TaggedError<RemoteLiveError>()('RemoteLiveError', {\n message: Schema.String,\n}) {}\n\n/**\n * The server refused a live subscription for what it asks (more ids of one\n * Entity than `maxIdsPerEntity`), before reading anything. The same\n * requirements are refused again, so a client does not reconnect it.\n */\nexport class RemoteLiveRefused extends Schema.TaggedError<RemoteLiveRefused>()(\n 'RemoteLiveRefused',\n { message: Schema.String },\n) {}\n\n/** The peer speaks another protocol version; nothing was read. */\nexport class RemoteProtocolError extends Schema.TaggedError<RemoteProtocolError>()(\n 'RemoteProtocolError',\n { message: Schema.String, expected: Schema.Number, received: Schema.Number },\n) {}\n\n/** A page size: a non-negative integer, refused at decode otherwise rather than defaulted. */\nexport const PageSize = Schema.Number.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0))\n\nexport const WindowSchema = Schema.Struct({\n first: Schema.optional(PageSize),\n last: Schema.optional(PageSize),\n after: Schema.optional(Schema.String),\n before: Schema.optional(Schema.String),\n})\n\n/** A request may not name more fields of one entity than this; a selection never does. */\nexport const MAX_FIELDS_PER_REQUEST = 256\n/** A selection may not nest relations deeper than this; the wire refuses more. */\nexport const MAX_RELATION_DEPTH = 8\n\nconst Fields = Schema.Array(Schema.String).check(Schema.isMaxLength(MAX_FIELDS_PER_REQUEST))\n\n/**\n * The slice required of a relation's target; the ids come from the parent's\n * refs. Built as `MAX_RELATION_DEPTH` nested structs rather than a recursive\n * schema, so a deeper selection is refused at decode with a schema error.\n */\nconst relationLevel = (depth: number): Schema.Codec<RelationRequirement, RelationRequirement> => {\n const slice = {\n entity: Schema.String,\n fields: Fields,\n windows: Schema.optional(Schema.Record(Schema.String, WindowSchema)),\n }\n // A struct drops an unknown key silently; the last level refuses one instead.\n return (depth === 0\n ? Schema.Struct({ ...slice, relations: Schema.optionalKey(Schema.Never) })\n : Schema.Struct({\n ...slice,\n relations: Schema.optional(Schema.Record(Schema.String, relationLevel(depth - 1))),\n })) as unknown as Schema.Codec<RelationRequirement, RelationRequirement>\n}\n\nexport const RelationRequest = relationLevel(MAX_RELATION_DEPTH - 1)\n\nexport const ReadRequest: Schema.Codec<Requirement, Requirement> = Schema.Struct({\n entity: Schema.String,\n id: Schema.String,\n fields: Fields,\n /** Pagination window per relation field. */\n windows: Schema.optional(Schema.Record(Schema.String, WindowSchema)),\n /** The slice required of each relation field's target, resolved in the same read. */\n relations: Schema.optional(Schema.Record(Schema.String, RelationRequest)),\n}) as unknown as Schema.Codec<Requirement, Requirement>\n\nexport const ReadBatch = Schema.Struct({\n version: Schema.Number,\n requests: Schema.Array(ReadRequest),\n})\n\nexport const NormalizedEntity = Schema.Struct({\n entity: Schema.String,\n id: Schema.String,\n values: Schema.Record(Schema.String, Schema.Unknown),\n})\n\n/**\n * Fields a read asked for that the server answered without, and will not\n * answer with: the client stops asking. It says nothing about why, so a rule\n * that withholds a field is not itself on the wire.\n */\nexport const SettledFields = Schema.Struct({\n entity: Schema.String,\n id: Schema.String,\n fields: Schema.Array(Schema.String),\n})\n\nexport const ReadBatchResult = Schema.Struct({\n entities: Schema.Array(NormalizedEntity),\n settled: Schema.Array(SettledFields),\n})\n\n/** A read a mutation's answer carries: what was asked, and what came back. */\nexport const AnswerRead = Schema.Struct({\n requests: Schema.Array(ReadRequest),\n result: ReadBatchResult,\n})\n\n/**\n * One operation's identity across every client: minted where it is first sent\n * and sent again with each retry of it. Bounded, since a server keys a record\n * of the write by it.\n */\nexport const OperationId = Schema.String.check(\n Schema.isMinLength(1),\n Schema.isMaxLength(128),\n Schema.isPattern(/^[A-Za-z0-9:._-]+$/),\n)\n\n/** A mutation request may name at most this many entities in `shown`. */\nexport const MAX_SHOWN_ENTITIES = 256\n\n/**\n * What a client reads of one entity's rows: a read request without its id. It\n * nests as deep as a read request does, so any slice a read asks can be sent.\n */\nexport const ShownSlice: Schema.Codec<RelationRequirement, RelationRequirement> = Schema.Struct({\n entity: Schema.String,\n fields: Fields,\n windows: Schema.optional(Schema.Record(Schema.String, WindowSchema)),\n relations: Schema.optional(Schema.Record(Schema.String, RelationRequest)),\n}) as unknown as Schema.Codec<RelationRequirement, RelationRequirement>\n\nexport const MutationRequest = Schema.Struct({\n /**\n * This client's id for the request, the same on each retry of it. It is\n * unique within one client's Model only (a counter there), so it names a\n * request to that client; `operation` names it to a server.\n */\n requestId: Schema.String,\n /** The operation's identity across clients: what a server keys a record of the write by. */\n operation: Schema.optional(OperationId),\n mutation: Schema.String,\n input: Schema.Unknown,\n /** For a mutation that is a `Write`: the input keys to write, when not all of them. */\n keys: Schema.optional(Schema.Array(Schema.String)),\n /**\n * When the reader acted, in milliseconds since the epoch: what the client\n * predicted the write's time as. A server takes it within its `clockSkew`\n * of its own clock. Optional, so a client and a server of either age agree.\n */\n now: Schema.optional(Schema.Int),\n /**\n * What the client's active reads show of each entity's rows. The server\n * answers, of each row the mutation names, the shown fields its answer\n * left out, read as any read is (`MutationResult.read`).\n */\n shown: Schema.optional(Schema.Array(ShownSlice).check(Schema.isMaxLength(MAX_SHOWN_ENTITIES))),\n})\n\nexport const LiveEdge = Schema.Struct({\n entity: Schema.String,\n id: Schema.String,\n key: Schema.String,\n})\n\n/** A connection change a mutation confirms: the same facts a live event carries, without a cursor. */\nexport const ConnectionChangeSchema = Schema.Union([\n Schema.Struct({\n _tag: Schema.Literal('Insert'),\n connection: Schema.String,\n position: Schema.Union([Schema.Literal('prepend'), Schema.Literal('append')]),\n edge: LiveEdge,\n }),\n Schema.Struct({ _tag: Schema.Literal('Remove'), connection: Schema.String, edge: LiveEdge }),\n])\n\nexport const MutationResult = Schema.Struct({\n output: Schema.Unknown,\n entities: Schema.Array(NormalizedEntity),\n /** Connection changes the mutation made, applied alongside its entity patches. */\n connections: Schema.optional(Schema.Array(ConnectionChangeSchema)),\n /** Entities the mutation deleted; the client knows them absent from then on. */\n deleted: Schema.optional(\n Schema.Array(Schema.Struct({ entity: Schema.String, id: Schema.String })),\n ),\n /**\n * A fresh read, after the write, of what the request's `shown` asks of the\n * rows the answer names: the requirements read and what came back, written\n * as a read is.\n */\n read: Schema.optional(AnswerRead),\n})\n\nexport const QueryRequest = Schema.Struct({\n query: Schema.String,\n input: Schema.Unknown,\n window: WindowSchema,\n /**\n * What to read of each item, as the relation slice a read asks the server\n * for. Absent for a query run without one: the response carries only edges,\n * and the client's read entry fetches fields in a second round trip.\n */\n select: Schema.optional(RelationRequest),\n})\n\n/** A live subscription may watch no more lists than this; each is run again every tick. */\nexport const MAX_LIVE_QUERIES = 32\n\nexport const LiveRequirement = Schema.Struct({\n version: Schema.Number,\n requirements: Schema.Array(ReadRequest),\n /** Lists read live (`Data.query(…, { live: true })`), each as its read sends it. */\n queries: Schema.optional(Schema.Array(QueryRequest).check(Schema.isMaxLength(MAX_LIVE_QUERIES))),\n /** Resume cursor; events at or before it are duplicates. */\n after: Schema.Number,\n})\n\n/**\n * A live change. Entity changes update the store; connection changes alter\n * membership and ordering; both carry a per-stream cursor.\n */\nexport const LiveChange = Schema.Union([\n Schema.Struct({\n _tag: Schema.Literal('EntityPatched'),\n cursor: Schema.Number,\n entity: Schema.String,\n id: Schema.String,\n values: Schema.Record(Schema.String, Schema.Unknown),\n changed: Schema.Array(Schema.String),\n }),\n Schema.Struct({\n _tag: Schema.Literal('EntityDeleted'),\n cursor: Schema.Number,\n entity: Schema.String,\n id: Schema.String,\n }),\n Schema.Struct({\n _tag: Schema.Literal('ConnectionInsert'),\n cursor: Schema.Number,\n connection: Schema.String,\n position: Schema.Union([Schema.Literal('prepend'), Schema.Literal('append')]),\n edge: LiveEdge,\n }),\n Schema.Struct({\n _tag: Schema.Literal('ConnectionRemove'),\n cursor: Schema.Number,\n connection: Schema.String,\n edge: LiveEdge,\n }),\n Schema.Struct({\n _tag: Schema.Literal('ConnectionInvalidate'),\n cursor: Schema.Number,\n connection: Schema.String,\n }),\n])\n\nexport const Read = Rpc.make('FoldkitRemoteRead', {\n payload: ReadBatch,\n success: ReadBatchResult,\n error: Schema.Union([RemoteReadError, RemoteProtocolError, RemoteUnauthenticated]),\n})\n\nexport const Mutate = Rpc.make('FoldkitRemoteMutate', {\n payload: MutationRequest,\n success: MutationResult,\n error: Schema.Union([RemoteMutationError, RemoteForbidden, RemoteUnauthenticated]),\n})\n\nexport const Live = Rpc.make('FoldkitRemoteLive', {\n payload: LiveRequirement,\n success: LiveChange,\n error: Schema.Union([\n RemoteLiveError,\n RemoteLiveRefused,\n RemoteProtocolError,\n RemoteUnauthenticated,\n ]),\n stream: true,\n})\n\nexport class RemoteQueryError extends Schema.TaggedError<RemoteQueryError>()('RemoteQueryError', {\n message: Schema.String,\n}) {}\n\nexport const WireBoundary = Schema.Union([\n Schema.Struct({ _tag: Schema.Literal('Terminal') }),\n Schema.Struct({ _tag: Schema.Literal('Cursor'), cursor: Schema.String }),\n Schema.Struct({ _tag: Schema.Literal('Unknown') }),\n])\n\nexport const QueryEdge = Schema.Struct({\n entity: Schema.String,\n id: Schema.String,\n key: Schema.String,\n})\n\nexport const QueryResult = Schema.Struct({\n edges: Schema.Array(QueryEdge),\n start: WireBoundary,\n end: WireBoundary,\n /**\n * The selected fields of the page's items, in the same shape a read batch\n * returns. Absent from a server that predates payload planning: the client\n * reads it as empty and fetches fields as before.\n */\n entities: Schema.optional(Schema.Array(NormalizedEntity)),\n settled: Schema.optional(Schema.Array(SettledFields)),\n})\n\nexport const QueryRpc = Rpc.make('FoldkitRemoteQuery', {\n payload: QueryRequest,\n success: QueryResult,\n error: Schema.Union([RemoteQueryError, RemoteUnauthenticated]),\n})\n\nexport const RemoteRpc = RpcGroup.make(Read, Mutate, QueryRpc, Live)\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,0BAA0B;AAEvC,IAAa,kBAAb,cAAqC,OAAO,YAA6B,CAAC,CAAC,mBAAmB,EAC5F,SAAS,OAAO,OAClB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,sBAAb,cAAyC,OAAO,YAAiC,CAAC,CAChF,uBACA;CACE,SAAS,OAAO;;CAEhB,SAAS,OAAO,SAAS,OAAO,OAAO;AACzC,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,oBAAb,cAAuC,OAAO,YAA+B,CAAC,CAAC,eAAe,EAC5F,SAAS,OAAO,OAClB,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,IAAa,kBAAb,cAAqC,OAAO,YAA6B,CAAC,CAAC,aAAa;CACtF,SAAS,OAAO;CAChB,QAAQ,OAAO,SAAS,OAAO,MAAM;AACvC,CAAC,CAAC,CAAC,CAAC;;;;;;;AAQJ,IAAa,wBAAb,cAA2C,OAAO,YAAmC,CAAC,CACpF,mBACA;CACE,SAAS,OAAO;CAChB,QAAQ,OAAO,SAAS,OAAO,MAAM;AACvC,CACF,CAAC,CAAC,CAAC;AAEH,IAAa,kBAAb,cAAqC,OA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eAAe,OAAO,MAAM;CACvC,OAAO,OAAO,EAAE,MAAM,OAAO,QAAQ,UAAU,EAAE,CAAC;CAClD,OAAO,OAAO;EAAE,MAAM,OAAO,QAAQ,QAAQ;EAAG,QAAQ,OAAO;CAAO,CAAC;CACvE,OAAO,OAAO,EAAE,MAAM,OAAO,QAAQ,SAAS,EAAE,CAAC;AACnD,CAAC;AAED,MAAa,YAAY,OAAO,OAAO;CACrC,QAAQ,OAAO;CACf,IAAI,OAAO;CACX,KAAK,OAAO;AACd,CAAC;AAED,MAAa,cAAc,OAAO,OAAO;CACvC,OAAO,OAAO,MAAM,SAAS;CAC7B,OAAO;CACP,KAAK;;;;;;CAML,UAAU,OAAO,SAAS,OAAO,MAAM,gBAAgB,CAAC;CACxD,SAAS,OAAO,SAAS,OAAO,MAAM,aAAa,CAAC;AACtD,CAAC;AAED,MAAa,WAAW,IAAI,KAAK,sBAAsB;CACrD,SAAS;CACT,SAAS;CACT,OAAO,OAAO,MAAM,CAAC,kBAAkB,qBAAqB,CAAC;AAC/D,CAAC;AAED,MAAa,YAAY,SAAS,KAAK,MAAM,QAAQ,UAAU,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit-remote",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Normalized application-facing server state for Foldkit: entities, selections, and the pure remote core.",
5
5
  "keywords": [
6
6
  "foldkit",
@@ -29,13 +29,18 @@
29
29
  "exports": {
30
30
  ".": {
31
31
  "foldkit-plus:source": "./src/index.ts",
32
- "types": "./dist/index.d.mts",
33
- "import": "./dist/index.mjs"
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.js"
34
34
  },
35
35
  "./port": {
36
36
  "foldkit-plus:source": "./src/port.ts",
37
- "types": "./dist/port.d.mts",
38
- "import": "./dist/port.mjs"
37
+ "types": "./dist/port.d.ts",
38
+ "import": "./dist/port.js"
39
+ },
40
+ "./testing": {
41
+ "foldkit-plus:source": "./src/testing.ts",
42
+ "types": "./dist/testing.d.ts",
43
+ "import": "./dist/testing.js"
39
44
  }
40
45
  },
41
46
  "files": [
@@ -44,21 +49,21 @@
44
49
  "LICENSE"
45
50
  ],
46
51
  "dependencies": {
47
- "foldkit-entity": "0.12.0",
48
- "foldkit-metadata": "0.1.0",
49
- "foldkit-surface": "0.10.2"
52
+ "foldkit-entity": "0.14.0",
53
+ "foldkit-surface": "0.11.0",
54
+ "foldkit-metadata": "0.1.0"
50
55
  },
51
56
  "peerDependencies": {
52
- "effect": "^4.0.0",
53
- "foldkit": "^0.169.0"
57
+ "effect": "^4.1.0",
58
+ "foldkit": "^0.170.0"
54
59
  },
55
60
  "devDependencies": {
56
- "@effect/platform-browser": "^4.0.5",
57
- "effect": "^4.0.5",
58
- "foldkit": "0.169.0",
61
+ "@effect/platform-browser": "^4.1.0",
62
+ "effect": "^4.1.0",
63
+ "foldkit": "0.170.0",
59
64
  "tsdown": "^0.23.1",
60
65
  "typescript": "7.0.2",
61
- "foldkit-bundle": "0.8.1"
66
+ "foldkit-bundle": "0.9.0"
62
67
  },
63
68
  "scripts": {
64
69
  "build": "tsdown",