@lunora/platform-cloudflare 1.0.0-alpha.15 → 1.0.0-alpha.17

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/dist/index.d.mts CHANGED
@@ -124,4 +124,114 @@ declare const createShardPlatform: (state: unknown) => ShardPlatform;
124
124
  * threaded through it.
125
125
  */
126
126
  declare const createWorkerPlatform: (env: unknown, options?: WorkerPlatformOptions) => WorkerPlatform;
127
- export { type ShardPlatform, type WorkerPlatform, type WorkerPlatformOptions, createShardAlarms, createShardDirectory, createShardHost, createShardKvStore, createShardPlatform, createSocketHost, createWorkerPlatform };
127
+ export { type ShardPlatform, type WorkerPlatform, type WorkerPlatformOptions,
128
+ /**
129
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
130
+ * `@lunora/platform` contracts.
131
+ *
132
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
133
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
134
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
135
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
136
+ * refactor of `@lunora/do`.
137
+ *
138
+ * # Why this depends on nothing but the contracts
139
+ *
140
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
141
+ * adapters that lived there, and so depended on the very package it was meant
142
+ * to make replaceable. That inverts the end-state, and with one host it also
143
+ * had zero consumers, so it was dissolved. This version is the other way up:
144
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
145
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
146
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
147
+ * provider API except through a contract.
148
+ */
149
+ createShardAlarms,
150
+ /**
151
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
152
+ * `@lunora/platform` contracts.
153
+ *
154
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
155
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
156
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
157
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
158
+ * refactor of `@lunora/do`.
159
+ *
160
+ * # Why this depends on nothing but the contracts
161
+ *
162
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
163
+ * adapters that lived there, and so depended on the very package it was meant
164
+ * to make replaceable. That inverts the end-state, and with one host it also
165
+ * had zero consumers, so it was dissolved. This version is the other way up:
166
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
167
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
168
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
169
+ * provider API except through a contract.
170
+ */
171
+ createShardDirectory,
172
+ /**
173
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
174
+ * `@lunora/platform` contracts.
175
+ *
176
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
177
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
178
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
179
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
180
+ * refactor of `@lunora/do`.
181
+ *
182
+ * # Why this depends on nothing but the contracts
183
+ *
184
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
185
+ * adapters that lived there, and so depended on the very package it was meant
186
+ * to make replaceable. That inverts the end-state, and with one host it also
187
+ * had zero consumers, so it was dissolved. This version is the other way up:
188
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
189
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
190
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
191
+ * provider API except through a contract.
192
+ */
193
+ createShardHost,
194
+ /**
195
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
196
+ * `@lunora/platform` contracts.
197
+ *
198
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
199
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
200
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
201
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
202
+ * refactor of `@lunora/do`.
203
+ *
204
+ * # Why this depends on nothing but the contracts
205
+ *
206
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
207
+ * adapters that lived there, and so depended on the very package it was meant
208
+ * to make replaceable. That inverts the end-state, and with one host it also
209
+ * had zero consumers, so it was dissolved. This version is the other way up:
210
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
211
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
212
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
213
+ * provider API except through a contract.
214
+ */
215
+ createShardKvStore, createShardPlatform,
216
+ /**
217
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
218
+ * `@lunora/platform` contracts.
219
+ *
220
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
221
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
222
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
223
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
224
+ * refactor of `@lunora/do`.
225
+ *
226
+ * # Why this depends on nothing but the contracts
227
+ *
228
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
229
+ * adapters that lived there, and so depended on the very package it was meant
230
+ * to make replaceable. That inverts the end-state, and with one host it also
231
+ * had zero consumers, so it was dissolved. This version is the other way up:
232
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
233
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
234
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
235
+ * provider API except through a contract.
236
+ */
237
+ createSocketHost, createWorkerPlatform };
package/dist/index.d.ts CHANGED
@@ -124,4 +124,114 @@ declare const createShardPlatform: (state: unknown) => ShardPlatform;
124
124
  * threaded through it.
125
125
  */
126
126
  declare const createWorkerPlatform: (env: unknown, options?: WorkerPlatformOptions) => WorkerPlatform;
127
- export { type ShardPlatform, type WorkerPlatform, type WorkerPlatformOptions, createShardAlarms, createShardDirectory, createShardHost, createShardKvStore, createShardPlatform, createSocketHost, createWorkerPlatform };
127
+ export { type ShardPlatform, type WorkerPlatform, type WorkerPlatformOptions,
128
+ /**
129
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
130
+ * `@lunora/platform` contracts.
131
+ *
132
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
133
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
134
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
135
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
136
+ * refactor of `@lunora/do`.
137
+ *
138
+ * # Why this depends on nothing but the contracts
139
+ *
140
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
141
+ * adapters that lived there, and so depended on the very package it was meant
142
+ * to make replaceable. That inverts the end-state, and with one host it also
143
+ * had zero consumers, so it was dissolved. This version is the other way up:
144
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
145
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
146
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
147
+ * provider API except through a contract.
148
+ */
149
+ createShardAlarms,
150
+ /**
151
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
152
+ * `@lunora/platform` contracts.
153
+ *
154
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
155
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
156
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
157
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
158
+ * refactor of `@lunora/do`.
159
+ *
160
+ * # Why this depends on nothing but the contracts
161
+ *
162
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
163
+ * adapters that lived there, and so depended on the very package it was meant
164
+ * to make replaceable. That inverts the end-state, and with one host it also
165
+ * had zero consumers, so it was dissolved. This version is the other way up:
166
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
167
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
168
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
169
+ * provider API except through a contract.
170
+ */
171
+ createShardDirectory,
172
+ /**
173
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
174
+ * `@lunora/platform` contracts.
175
+ *
176
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
177
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
178
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
179
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
180
+ * refactor of `@lunora/do`.
181
+ *
182
+ * # Why this depends on nothing but the contracts
183
+ *
184
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
185
+ * adapters that lived there, and so depended on the very package it was meant
186
+ * to make replaceable. That inverts the end-state, and with one host it also
187
+ * had zero consumers, so it was dissolved. This version is the other way up:
188
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
189
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
190
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
191
+ * provider API except through a contract.
192
+ */
193
+ createShardHost,
194
+ /**
195
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
196
+ * `@lunora/platform` contracts.
197
+ *
198
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
199
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
200
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
201
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
202
+ * refactor of `@lunora/do`.
203
+ *
204
+ * # Why this depends on nothing but the contracts
205
+ *
206
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
207
+ * adapters that lived there, and so depended on the very package it was meant
208
+ * to make replaceable. That inverts the end-state, and with one host it also
209
+ * had zero consumers, so it was dissolved. This version is the other way up:
210
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
211
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
212
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
213
+ * provider API except through a contract.
214
+ */
215
+ createShardKvStore, createShardPlatform,
216
+ /**
217
+ * `@lunora/platform-cloudflare` — the Cloudflare implementation of the
218
+ * `@lunora/platform` contracts.
219
+ *
220
+ * `@lunora/platform` says what a host must provide; this says how Cloudflare
221
+ * provides it, over `DurableObjectState`, hibernatable WebSockets, and a
222
+ * `DurableObjectNamespace`. A second target ships the same surface from its own
223
+ * `@lunora/platform-<target>` package, so adding one is a sibling rather than a
224
+ * refactor of `@lunora/do`.
225
+ *
226
+ * # Why this depends on nothing but the contracts
227
+ *
228
+ * An earlier version of this package sat *above* `@lunora/do` — it composed
229
+ * adapters that lived there, and so depended on the very package it was meant
230
+ * to make replaceable. That inverts the end-state, and with one host it also
231
+ * had zero consumers, so it was dissolved. This version is the other way up:
232
+ * the adapters live here, `@lunora/do` depends on this, and the only imports
233
+ * are `@lunora/platform` plus Cloudflare's own types. That is what makes the
234
+ * seam real rather than aspirational — `@lunora/do` can no longer reach a
235
+ * provider API except through a contract.
236
+ */
237
+ createSocketHost, createWorkerPlatform };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{createShardAlarms as t,createShardDirectory as a,createShardHost as o,createShardKvStore as c,createSocketHost as S}from"./packem_shared/createShardAlarms-D3c8M2o_.mjs";import{createShardPlatform as h,createWorkerPlatform as m}from"./packem_shared/createShardPlatform-CgM_gBah.mjs";export{t as createShardAlarms,a as createShardDirectory,o as createShardHost,c as createShardKvStore,h as createShardPlatform,S as createSocketHost,m as createWorkerPlatform};
1
+ import{createShardAlarms as t,createShardDirectory as a,createShardHost as o,createShardKvStore as c,createSocketHost as S}from"./packem_shared/createShardAlarms-B8fXiSYz.mjs";import{createShardPlatform as h,createWorkerPlatform as m}from"./packem_shared/createShardPlatform-BQii5Qan.mjs";export{t as createShardAlarms,a as createShardDirectory,o as createShardHost,c as createShardKvStore,h as createShardPlatform,S as createSocketHost,m as createWorkerPlatform};
@@ -0,0 +1 @@
1
+ import{LunoraError as f}from"@lunora/errors";const w=(t,e,r)=>{const c=t.storage.sql;if(typeof c?.exec!="function")throw new TypeError("storage.sql.exec is not available on this DurableObjectState");return c.exec(e,...r)},p=t=>({delete:()=>typeof t.deleteAlarm=="function"?t.deleteAlarm():Promise.resolve(),get:()=>typeof t.getAlarm=="function"?t.getAlarm():null,set:e=>typeof t.setAlarm=="function"?t.setAlarm(e):Promise.resolve()}),b=(t,e)=>{if(!(!(t instanceof Error)||t===e||t.cause!==void 0))try{Object.defineProperty(t,"cause",{configurable:!0,value:e,writable:!0})}catch{}},C=t=>{const{storage:e}=t,r={get databaseSize(){return t.storage.sql?.databaseSize},exec:(o,...a)=>w(t,o,a)},c=p(e),i=async o=>{if(typeof t.blockConcurrencyWhile=="function"){const a=await t.blockConcurrencyWhile(async()=>{try{return{ok:!0,value:await o()}}catch(s){return{error:s,ok:!1}}});if(!a.ok)throw a.error;return a.value}return o()},n=async o=>{const a=e;if(typeof a?.transaction=="function"){let s;try{return await a.transaction(async()=>{try{return await o()}catch(l){throw s={value:l},l}})}catch(l){throw s?(b(s.value,l),s.value):l}}return o()};return{alarms:c,runSerialized:i,shardKey:t.id?.name,sql:r,transaction:n,waitUntil:typeof t.waitUntil=="function"?o=>{t.waitUntil(o)}:void 0}},D=t=>({delete:async e=>!!await t.delete(e),get:e=>t.get(e),list:e=>{if(typeof t.list!="function")throw new TypeError("storage.list is not available on this DurableObjectStorage");return t.list(e)},put:(e,r)=>t.put(e,r)}),d="lunora-socket:",u=new WeakMap,h=new WeakMap;let g=0;const v=(t,e)=>{const{getTags:r}=t;if(typeof r=="function")try{return r.call(t,e).find(c=>c.startsWith(d))}catch{return}},E=(t,e)=>{const r=v(t,e);if(r!==void 0)return r.slice(d.length);const c=u.get(e);if(c!==void 0)return c;const i=h.get(e);if(i!==void 0)return i;g+=1;const n=`cf-socket-${String(g)}`;return h.set(e,n),n},y=10,S=256,k=1,m=t=>{if(!t||t.length===0)return;const e=y-k;if(t.length>e)throw new f("SOCKET_TAG_BUDGET_EXCEEDED",`${String(t.length)} tags supplied; Cloudflare allows ${String(y)} per socket and 1 is reserved for the host's identity tag — pass at most ${String(e)}.`);const r=t.find(c=>c.length>S);if(r!==void 0)throw new f("SOCKET_TAG_BUDGET_EXCEEDED",`Tag ${JSON.stringify(r)} is ${String(r.length)} characters; Cloudflare allows at most ${String(S)} characters per tag.`)},_=t=>{const e=new WeakSet;let r=0,c;const i=()=>{const n=t.getWebSockets();return(c?.generation!==r||c.length!==n.length)&&(c={generation:r,length:n.length,set:new WeakSet(n)}),c.set};return{accept:(n,o,a)=>{m(a);const s=n,l=crypto.randomUUID();return t.acceptWebSocket(s,[`${d}${l}`,...a??[]]),u.set(s,l),r+=1,o!==void 0&&s.serializeAttachment?.(o),s},getSockets:n=>t.getWebSockets(n),handleFor:n=>{const o=n;if(u.has(o)||v(t,o)!==void 0)return o;if(!e.has(o)){if(i().has(o))return o;e.add(o)}},idFor:n=>E(t,n)}},T=t=>{const e=i=>({fetch:n=>i.fetch(n)}),r=i=>i===void 0?void 0:{locationHint:i};return{get:(i,n)=>e(t.get(i,r(n))),getByName:(i,n)=>e(t.get(t.idFromName(i),r(n))),idForName:i=>t.idFromName(i),jurisdiction:i=>T(t.jurisdiction(i))}};export{p as createShardAlarms,T as createShardDirectory,C as createShardHost,D as createShardKvStore,_ as createSocketHost};
@@ -0,0 +1 @@
1
+ import{createSocketHost as n,createShardHost as d,createShardKvStore as l,createShardDirectory as i}from"./createShardAlarms-B8fXiSYz.mjs";import{CLOUDFLARE_CAPABILITIES as c}from"@lunora/platform";const h=e=>{const r=e;return{kv:l(r.storage),shard:d(r),sockets:n(r)}},m=(e,r={})=>{const s=e??{},a=o=>{const t=s[o];if(t==null)throw new Error(`@lunora/platform-cloudflare: no Durable Object namespace bound as "${o}" — add it to wrangler.jsonc's durable_objects.bindings`);return i(t)};return r.scheduler===void 0?{capabilities:c,directory:a}:{capabilities:c,directory:a,scheduler:r.scheduler}};export{h as createShardPlatform,m as createWorkerPlatform};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/platform-cloudflare",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "Cloudflare implementation of the Lunora platform contracts: ShardHost, SocketHost, ShardDirectory, ShardKvStore over Durable Objects",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -43,8 +43,8 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "@lunora/errors": "1.0.0-alpha.21",
47
- "@lunora/platform": "1.0.0-alpha.10"
46
+ "@lunora/errors": "1.0.0-alpha.22",
47
+ "@lunora/platform": "1.0.0-alpha.12"
48
48
  },
49
49
  "engines": {
50
50
  "node": "^22.15.0 || >=24.11.0"
@@ -1 +0,0 @@
1
- import{LunoraError as g}from"@lunora/errors";const S=(t,e,n)=>{const r=t.storage.sql;if(typeof r?.exec!="function")throw new TypeError("storage.sql.exec is not available on this DurableObjectState");return r.exec(e,...n)},m=t=>({delete:()=>typeof t.deleteAlarm=="function"?t.deleteAlarm():Promise.resolve(),get:()=>typeof t.getAlarm=="function"?t.getAlarm():null,set:e=>typeof t.setAlarm=="function"?t.setAlarm(e):Promise.resolve()}),v=(t,e)=>{if(!(!(t instanceof Error)||t===e||t.cause!==void 0))try{Object.defineProperty(t,"cause",{configurable:!0,value:e,writable:!0})}catch{}},T=t=>{const{storage:e}=t,n={get databaseSize(){return t.storage.sql?.databaseSize},exec:(a,...s)=>S(t,a,s)},r=m(e),i=async a=>{if(typeof t.blockConcurrencyWhile=="function"){const s=await t.blockConcurrencyWhile(async()=>{try{return{ok:!0,value:await a()}}catch(c){return{error:c,ok:!1}}});if(!s.ok)throw s.error;return s.value}return a()},o=async a=>{const s=e;if(typeof s?.transaction=="function"){let c;try{return await s.transaction(async()=>{try{return await a()}catch(l){throw c={value:l},l}})}catch(l){throw c?(v(c.value,l),c.value):l}}return a()};return{alarms:r,runSerialized:i,shardKey:t.id?.name,sql:n,transaction:o,waitUntil:typeof t.waitUntil=="function"?a=>{t.waitUntil(a)}:void 0}},W=t=>({delete:async e=>!!await t.delete(e),get:e=>t.get(e),list:e=>{if(typeof t.list!="function")throw new TypeError("storage.list is not available on this DurableObjectStorage");return t.list(e)},put:(e,n)=>t.put(e,n)}),f="lunora-socket:",u=new WeakMap,d=new WeakMap;let h=0;const w=(t,e)=>{const{getTags:n}=t;if(typeof n=="function")try{return n.call(t,e).find(r=>r.startsWith(f))}catch{return}},k=(t,e)=>{const n=w(t,e);if(n!==void 0)return n.slice(f.length);const r=u.get(e);if(r!==void 0)return r;const i=d.get(e);if(i!==void 0)return i;h+=1;const o=`cf-socket-${String(h)}`;return d.set(e,o),o},y=10,p=256,b=1,E=t=>{if(!t||t.length===0)return;const e=y-b;if(t.length>e)throw new g("SOCKET_TAG_BUDGET_EXCEEDED",`${String(t.length)} tags supplied; Cloudflare allows ${String(y)} per socket and 1 is reserved for the host's identity tag — pass at most ${String(e)}.`);const n=t.find(r=>r.length>p);if(n!==void 0)throw new g("SOCKET_TAG_BUDGET_EXCEEDED",`Tag ${JSON.stringify(n)} is ${String(n.length)} characters; Cloudflare allows at most ${String(p)} characters per tag.`)},$=t=>{const e=new WeakSet;let n=0,r;const i=()=>{const o=t.getWebSockets();return(r?.generation!==n||r.length!==o.length)&&(r={generation:n,length:o.length,set:new WeakSet(o)}),r.set};return{accept:(o,a,s)=>{E(s);const c=o,l=crypto.randomUUID();return t.acceptWebSocket(c,[`${f}${l}`,...s??[]]),u.set(c,l),n+=1,a!==void 0&&c.serializeAttachment?.(a),c},getSockets:o=>t.getWebSockets(o),handleFor:o=>{const a=o;if(u.has(a)||w(t,a)!==void 0)return a;if(!e.has(a)){if(i().has(a))return a;e.add(a)}},idFor:o=>k(t,o)}},A=t=>{const e=r=>({fetch:i=>r.fetch(i)}),n=r=>r===void 0?void 0:{locationHint:r};return{get:(r,i)=>e(t.get(r,n(i))),getByName:(r,i)=>e(t.get(t.idFromName(r),n(i))),idForName:r=>t.idFromName(r),jurisdiction:r=>A(t.jurisdiction(r))}};export{m as createShardAlarms,A as createShardDirectory,T as createShardHost,W as createShardKvStore,$ as createSocketHost};
@@ -1 +0,0 @@
1
- import{CLOUDFLARE_CAPABILITIES as c}from"@lunora/platform";import{createSocketHost as d,createShardHost as n,createShardKvStore as i,createShardDirectory as l}from"./createShardAlarms-D3c8M2o_.mjs";const b=e=>{const r=e;return{kv:i(r.storage),shard:n(r),sockets:d(r)}},m=(e,r={})=>{const s=e??{},t=o=>{const a=s[o];if(a==null)throw new Error(`@lunora/platform-cloudflare: no Durable Object namespace bound as "${o}" — add it to wrangler.jsonc's durable_objects.bindings`);return l(a)};return r.scheduler===void 0?{capabilities:c,directory:t}:{capabilities:c,directory:t,scheduler:r.scheduler}};export{b as createShardPlatform,m as createWorkerPlatform};