@lunora/studio 1.0.0-alpha.387 → 1.0.0-alpha.389

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 (102) hide show
  1. package/dist/packem_chunks/ai-knowledge.mjs +1 -1
  2. package/dist/standalone/{chunk-B2QIV4WC.js → chunk-23MMGFHI.js} +1 -1
  3. package/dist/standalone/{chunk-457LPY43.js → chunk-2CDROYSG.js} +1 -1
  4. package/dist/standalone/{chunk-OKZINWBB.js → chunk-2D4WBSDO.js} +1 -1
  5. package/dist/standalone/{chunk-KFPV6FAK.js → chunk-2M37OAK3.js} +1 -1
  6. package/dist/standalone/{chunk-ZLELD7AD.js → chunk-2YDK4MZM.js} +1 -1
  7. package/dist/standalone/chunk-2ZJJH4YN.js +33 -0
  8. package/dist/standalone/{chunk-UVBNLJ2Q.js → chunk-375GZTYC.js} +1 -1
  9. package/dist/standalone/{chunk-3Y4QC5Y3.js → chunk-3OVQC66W.js} +1 -1
  10. package/dist/standalone/{chunk-HFPX37U7.js → chunk-3WYPRZY3.js} +1 -1
  11. package/dist/standalone/{chunk-KSEWJNEY.js → chunk-3YCWRKSW.js} +1 -1
  12. package/dist/standalone/{chunk-VEEFAOKX.js → chunk-4MFQ4XEJ.js} +1 -1
  13. package/dist/standalone/{chunk-PUYNCASR.js → chunk-4YVCKOYF.js} +1 -1
  14. package/dist/standalone/{chunk-GFOHMAH3.js → chunk-5EIGSLIK.js} +1 -1
  15. package/dist/standalone/{chunk-PROLM3J5.js → chunk-5ZWJVXDN.js} +1 -1
  16. package/dist/standalone/{chunk-ODV4EB3C.js → chunk-6K4F727K.js} +1 -1
  17. package/dist/standalone/{chunk-J4JDBEID.js → chunk-7ASIMMZY.js} +1 -1
  18. package/dist/standalone/{chunk-QK4NIT57.js → chunk-ADS4BJ7K.js} +1 -1
  19. package/dist/standalone/{chunk-RAJO2KOX.js → chunk-APCHI5CD.js} +1 -1
  20. package/dist/standalone/{chunk-HSL3R24X.js → chunk-AQG5OGO4.js} +1 -1
  21. package/dist/standalone/{chunk-MMRSSV2C.js → chunk-ATBPQT7F.js} +1 -1
  22. package/dist/standalone/{chunk-V7EUTFAA.js → chunk-AXB32N5O.js} +1 -1
  23. package/dist/standalone/{chunk-TQVX4KLJ.js → chunk-AXDXIMCN.js} +1 -1
  24. package/dist/standalone/{chunk-UV6GPH2E.js → chunk-BHUWAGFN.js} +1 -1
  25. package/dist/standalone/{chunk-DUNKBNMY.js → chunk-BRPLE2Z6.js} +1 -1
  26. package/dist/standalone/{chunk-56MOCXLS.js → chunk-BU5VWXRR.js} +1 -1
  27. package/dist/standalone/{chunk-DG5IPCQV.js → chunk-BWBECJFT.js} +1 -1
  28. package/dist/standalone/{chunk-FFECJKHB.js → chunk-BWHVY6L6.js} +1 -1
  29. package/dist/standalone/{chunk-NVMQPIRS.js → chunk-CBTPJPCZ.js} +1 -1
  30. package/dist/standalone/{chunk-ILPLYMU4.js → chunk-CFQQHZYU.js} +1 -1
  31. package/dist/standalone/{chunk-RUAE5VGJ.js → chunk-CO6R6GCX.js} +1 -1
  32. package/dist/standalone/{chunk-U5YP7MSK.js → chunk-CP3LCFFM.js} +1 -1
  33. package/dist/standalone/{chunk-QAETUNZX.js → chunk-CQDENTSP.js} +1 -1
  34. package/dist/standalone/{chunk-D34KO2UK.js → chunk-CVJDEN5L.js} +1 -1
  35. package/dist/standalone/{chunk-SALLT4EA.js → chunk-CXXCVBMK.js} +1 -1
  36. package/dist/standalone/{chunk-2IZDKUFI.js → chunk-CY45AO5T.js} +1 -1
  37. package/dist/standalone/{chunk-DUX2Q5UM.js → chunk-DZV6YFWZ.js} +1 -1
  38. package/dist/standalone/{chunk-5AVK4OU3.js → chunk-EKXAE4PS.js} +1 -1
  39. package/dist/standalone/{chunk-3R6W72RH.js → chunk-ELPLRD4S.js} +1 -1
  40. package/dist/standalone/{chunk-5LJYJ5SF.js → chunk-EMZ7RPR3.js} +1 -1
  41. package/dist/standalone/{chunk-XY5UOZMD.js → chunk-ERUKFS3I.js} +1 -1
  42. package/dist/standalone/{chunk-S7NFUY75.js → chunk-EYSF4DHD.js} +1 -1
  43. package/dist/standalone/{chunk-UDBPUH63.js → chunk-EZMAQE3T.js} +1 -1
  44. package/dist/standalone/{chunk-4KVCH3A4.js → chunk-FKAOFBS3.js} +1 -1
  45. package/dist/standalone/{chunk-J6NDZCBQ.js → chunk-HCK62XWB.js} +1 -1
  46. package/dist/standalone/{chunk-CD2LQVUA.js → chunk-HJOXP6C3.js} +1 -1
  47. package/dist/standalone/{chunk-QS2BPA4D.js → chunk-HLBZ7OAO.js} +1 -1
  48. package/dist/standalone/{chunk-S3TDGFRE.js → chunk-HMMALUXM.js} +1 -1
  49. package/dist/standalone/{chunk-TWNPQQS7.js → chunk-HUL247LG.js} +1 -1
  50. package/dist/standalone/{chunk-XUS65GNY.js → chunk-I6YVDNKQ.js} +1 -1
  51. package/dist/standalone/chunk-IL64HWFW.js +1 -0
  52. package/dist/standalone/{chunk-THB7DCWF.js → chunk-IXCSVK2Z.js} +1 -1
  53. package/dist/standalone/{chunk-54X7HWI6.js → chunk-JQBVRWFN.js} +1 -1
  54. package/dist/standalone/{chunk-VXMAQB2K.js → chunk-JZN3MNJX.js} +1 -1
  55. package/dist/standalone/{chunk-RDYGUTWW.js → chunk-K2LXQ3LS.js} +1 -1
  56. package/dist/standalone/{chunk-SB54Y4G6.js → chunk-KGQPMSNY.js} +1 -1
  57. package/dist/standalone/{chunk-E5GKOI3R.js → chunk-KIQ34774.js} +1 -1
  58. package/dist/standalone/{chunk-EK74664L.js → chunk-KZXSJF7K.js} +1 -1
  59. package/dist/standalone/{chunk-O5VYYMWA.js → chunk-L6VJTINV.js} +1 -1
  60. package/dist/standalone/{chunk-6AOWASDA.js → chunk-L7TFQUD7.js} +1 -1
  61. package/dist/standalone/{chunk-MVRBX7HB.js → chunk-LLSK6QBX.js} +1 -1
  62. package/dist/standalone/{chunk-BWS7JUQV.js → chunk-LOEVTOKP.js} +1 -1
  63. package/dist/standalone/{chunk-KDMDI7KA.js → chunk-LRUYEVHH.js} +1 -1
  64. package/dist/standalone/{chunk-57F7KSWY.js → chunk-LYWT6GTX.js} +1 -1
  65. package/dist/standalone/{chunk-CJ2V577P.js → chunk-MNN3YCKF.js} +1 -1
  66. package/dist/standalone/{chunk-2LKJSQKF.js → chunk-NAGIOR23.js} +1 -1
  67. package/dist/standalone/{chunk-2L3WHXJV.js → chunk-NFI2TNKU.js} +1 -1
  68. package/dist/standalone/{chunk-M4TYLAUX.js → chunk-NP6CBOPK.js} +1 -1
  69. package/dist/standalone/{chunk-VOQK6ERC.js → chunk-NPKGC4AM.js} +1 -1
  70. package/dist/standalone/{chunk-G7KYDZGL.js → chunk-O66HDCZT.js} +1 -1
  71. package/dist/standalone/{chunk-OGIWPH2B.js → chunk-OJR7BDKC.js} +1 -1
  72. package/dist/standalone/{chunk-KPX6GS6G.js → chunk-OQTMT64P.js} +1 -1
  73. package/dist/standalone/{chunk-C2AMUDOR.js → chunk-OWCTA7GY.js} +1 -1
  74. package/dist/standalone/{chunk-7KNQ44FF.js → chunk-P3ML7HGE.js} +1 -1
  75. package/dist/standalone/{chunk-6GIVSDLA.js → chunk-PBXRUYD3.js} +1 -1
  76. package/dist/standalone/{chunk-QB75Q7U4.js → chunk-QFN62JQJ.js} +1 -1
  77. package/dist/standalone/{chunk-PVNVHQS5.js → chunk-QTWNCDLK.js} +1 -1
  78. package/dist/standalone/{chunk-FFNYPIIW.js → chunk-SGIEXE5J.js} +1 -1
  79. package/dist/standalone/{chunk-KW5PNET5.js → chunk-U5UEDY4E.js} +1 -1
  80. package/dist/standalone/{chunk-KAWNPEUA.js → chunk-U7NVTULW.js} +1 -1
  81. package/dist/standalone/{chunk-Q3U7OEDK.js → chunk-UFS6UP4Z.js} +1 -1
  82. package/dist/standalone/{chunk-SNJ3ZOV2.js → chunk-UL5XVKGR.js} +1 -1
  83. package/dist/standalone/{chunk-SRNRWSMY.js → chunk-V3DOKU22.js} +1 -1
  84. package/dist/standalone/{chunk-I2C3K4SJ.js → chunk-V4B7ZPEG.js} +1 -1
  85. package/dist/standalone/{chunk-THRRRMIZ.js → chunk-V5TGDG6U.js} +1 -1
  86. package/dist/standalone/{chunk-DPSTEE4D.js → chunk-VM2V5UUW.js} +1 -1
  87. package/dist/standalone/{chunk-4AGOKKRZ.js → chunk-VQQEDEHH.js} +1 -1
  88. package/dist/standalone/{chunk-DWNWEMQK.js → chunk-W5BTAOHO.js} +1 -1
  89. package/dist/standalone/{chunk-RBTRTSXY.js → chunk-WEPANQGT.js} +1 -1
  90. package/dist/standalone/{chunk-CDDK3RFD.js → chunk-WLUWQ24M.js} +1 -1
  91. package/dist/standalone/{chunk-76CCNRPQ.js → chunk-WXZ334CL.js} +1 -1
  92. package/dist/standalone/{chunk-TN4Z3P6S.js → chunk-XV2XEUUB.js} +1 -1
  93. package/dist/standalone/{chunk-K55BSHNZ.js → chunk-Y2AKO63C.js} +1 -1
  94. package/dist/standalone/{chunk-HB2FLDDU.js → chunk-Y5QMX4YG.js} +1 -1
  95. package/dist/standalone/{chunk-PAFHBQFL.js → chunk-YLC2ZYCL.js} +1 -1
  96. package/dist/standalone/{chunk-H5XMXLKP.js → chunk-ZADOHFZB.js} +1 -1
  97. package/dist/standalone/{chunk-J3ZEO3PJ.js → chunk-ZJIYJZ6F.js} +1 -1
  98. package/dist/standalone/{chunk-BADXUCOT.js → chunk-ZP453BM4.js} +1 -1
  99. package/dist/standalone/studio.js +1 -1
  100. package/package.json +2 -2
  101. package/dist/standalone/chunk-PN7JHEYW.js +0 -33
  102. package/dist/standalone/chunk-WLQL3I62.js +0 -1
@@ -1,33 +0,0 @@
1
- import{a as be,b as Se}from"./chunk-PDBW6GTJ.js";import{a as st}from"./chunk-ADABTCDI.js";import{a as s,b as oe,d as Ae}from"./chunk-5PEAXTYQ.js";var Pe=oe((ke,Z)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Z=="object"&&Z.exports?Z.exports=t():e.moo=t()})(ke,function(){"use strict";var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=typeof new RegExp().sticky=="boolean";function a(i){return i&&t.call(i)==="[object RegExp]"}s(a,"isRegExp");function n(i){return i&&typeof i=="object"&&!a(i)&&!Array.isArray(i)}s(n,"isObject");function l(i){return i.replace(/[-\/\\^$*+?.()|[\]{}]/g,function(o){return o==="-"?"\\x2d":"\\"+o})}s(l,"reEscape");function u(i){var o=new RegExp("|"+i);return o.exec("").length-1}s(u,"reGroups");function g(i){return"("+i+")"}s(g,"reCapture");function w(i){if(!i.length)return"(?!)";var o=i.map(function(c){return"(?:"+c+")"}).join("|");return"(?:"+o+")"}s(w,"reUnion");function E(i){if(typeof i=="string")return"(?:"+l(i)+")";if(a(i)){if(i.ignoreCase)throw new Error("RegExp /i flag not allowed");if(i.global)throw new Error("RegExp /g flag is implied");if(i.sticky)throw new Error("RegExp /y flag is implied");if(i.multiline)throw new Error("RegExp /m flag is implied");return i.source}else throw new Error("Not a pattern: "+i)}s(E,"regexpOrLiteral");function I(i,o){return i.length>o?i:Array(o-i.length+1).join(" ")+i}s(I,"pad");function R(i,o){for(var c=i.length,d=0;;){var p=i.lastIndexOf(`
2
- `,c-1);if(p===-1||(d++,c=p,d===o)||c===0)break}var h=d<o?0:c+1;return i.substring(h).split(`
3
- `)}s(R,"lastNLines");function P(i){for(var o=Object.getOwnPropertyNames(i),c=[],d=0;d<o.length;d++){var p=o[d],h=i[p],m=[].concat(h);if(p==="include"){for(var y=0;y<m.length;y++)c.push({include:m[y]});continue}var _=[];m.forEach(function(f){n(f)?(_.length&&c.push(D(p,_)),c.push(D(p,f)),_=[]):_.push(f)}),_.length&&c.push(D(p,_))}return c}s(P,"objectToRules");function M(i){for(var o=[],c=0;c<i.length;c++){var d=i[c];if(d.include){for(var p=[].concat(d.include),h=0;h<p.length;h++)o.push({include:p[h]});continue}if(!d.type)throw new Error("Rule has no type: "+JSON.stringify(d));o.push(D(d.type,d))}return o}s(M,"arrayToRules");function D(i,o){if(n(o)||(o={match:o}),o.include)throw new Error("Matching rules cannot also include states");var c={defaultType:i,lineBreaks:!!o.error||!!o.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var d in o)e.call(o,d)&&(c[d]=o[d]);if(typeof c.type=="string"&&i!==c.type)throw new Error("Type transform cannot be a string (type '"+c.type+"' for token '"+i+"')");var p=c.match;return c.match=Array.isArray(p)?p:p?[p]:[],c.match.sort(function(h,m){return a(h)&&a(m)?0:a(m)?-1:a(h)?1:m.length-h.length}),c}s(D,"ruleOptions");function b(i){return Array.isArray(i)?M(i):P(i)}s(b,"toRules");var Q=D("error",{lineBreaks:!0,shouldThrow:!0});function F(i,o){for(var c=null,d=Object.create(null),p=!0,h=null,m=[],y=[],_=0;_<i.length;_++)i[_].fallback&&(p=!1);for(var _=0;_<i.length;_++){var f=i[_];if(f.include)throw new Error("Inheritance is not allowed in stateless lexers");if(f.error||f.fallback){if(c)throw!f.fallback==!c.fallback?new Error("Multiple "+(f.fallback?"fallback":"error")+" rules not allowed (for token '"+f.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+f.defaultType+"')");c=f}var O=f.match.slice();if(p)for(;O.length&&typeof O[0]=="string"&&O[0].length===1;){var U=O.shift();d[U.charCodeAt(0)]=f}if(f.pop||f.push||f.next){if(!o)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+f.defaultType+"')");if(f.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+f.defaultType+"')")}if(O.length!==0){p=!1,m.push(f);for(var L=0;L<O.length;L++){var x=O[L];if(a(x)){if(h===null)h=x.unicode;else if(h!==x.unicode&&f.fallback===!1)throw new Error("If one rule is /u then all must be")}}var G=w(O.map(E)),S=new RegExp(G);if(S.test(""))throw new Error("RegExp matches empty string: "+S);var W=u(G);if(W>0)throw new Error("RegExp has capture groups: "+S+`
4
- Use (?: \u2026 ) instead`);if(!f.lineBreaks&&S.test(`
5
- `))throw new Error("Rule should declare lineBreaks: "+S);y.push(g(G))}}var q=c&&c.fallback,K=r&&!q?"ym":"gm",z=r||q?"":"|";h===!0&&(K+="u");var at=new RegExp(w(y)+z,K);return{regexp:at,groups:m,fast:d,error:c||Q}}s(F,"compileRules");function H(i){var o=F(b(i));return new A({start:o},"start")}s(H,"compile");function B(i,o,c){var d=i&&(i.push||i.next);if(d&&!c[d])throw new Error("Missing state '"+d+"' (in token '"+i.defaultType+"' of state '"+o+"')");if(i&&i.pop&&+i.pop!=1)throw new Error("pop must be 1 (in token '"+i.defaultType+"' of state '"+o+"')")}s(B,"checkStateGroup");function ie(i,o){var c=i.$all?b(i.$all):[];delete i.$all;var d=Object.getOwnPropertyNames(i);o||(o=d[0]);for(var p=Object.create(null),h=0;h<d.length;h++){var m=d[h];p[m]=b(i[m]).concat(c)}for(var h=0;h<d.length;h++)for(var m=d[h],y=p[m],_=Object.create(null),f=0;f<y.length;f++){var O=y[f];if(O.include){var U=[f,1];if(O.include!==m&&!_[O.include]){_[O.include]=!0;var L=p[O.include];if(!L)throw new Error("Cannot include nonexistent state '"+O.include+"' (in state '"+m+"')");for(var x=0;x<L.length;x++){var G=L[x];y.indexOf(G)===-1&&U.push(G)}}y.splice.apply(y,U),f--}}for(var S=Object.create(null),h=0;h<d.length;h++){var m=d[h];S[m]=F(p[m],!0)}for(var h=0;h<d.length;h++){for(var W=d[h],q=S[W],K=q.groups,f=0;f<K.length;f++)B(K[f],W,S);for(var z=Object.getOwnPropertyNames(q.fast),f=0;f<z.length;f++)B(q.fast[z[f]],W,S)}return new A(S,o)}s(ie,"compileStates");function et(i){for(var o=typeof Map<"u",c=o?new Map:Object.create(null),d=Object.getOwnPropertyNames(i),p=0;p<d.length;p++){var h=d[p],m=i[h],y=Array.isArray(m)?m:[m];y.forEach(function(_){if(typeof _!="string")throw new Error("keyword must be string (in keyword '"+h+"')");o?c.set(_,h):c[_]=h})}return function(_){return o?c.get(_):c[_]}}s(et,"keywordTransform");var A=s(function(i,o){this.startState=o,this.states=i,this.buffer="",this.stack=[],this.reset()},"Lexer");A.prototype.reset=function(i,o){return this.buffer=i||"",this.index=0,this.line=o?o.line:1,this.col=o?o.col:1,this.queuedToken=o?o.queuedToken:null,this.queuedText=o?o.queuedText:"",this.queuedThrow=o?o.queuedThrow:null,this.setState(o?o.state:this.startState),this.stack=o&&o.stack?o.stack.slice():[],this},A.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},A.prototype.setState=function(i){if(!(!i||this.state===i)){this.state=i;var o=this.states[i];this.groups=o.groups,this.error=o.error,this.re=o.regexp,this.fast=o.fast}},A.prototype.popState=function(){this.setState(this.stack.pop())},A.prototype.pushState=function(i){this.stack.push(this.state),this.setState(i)};var tt=r?function(i,o){return i.exec(o)}:function(i,o){var c=i.exec(o);return c[0].length===0?null:c};A.prototype._getGroup=function(i){for(var o=this.groups.length,c=0;c<o;c++)if(i[c+1]!==void 0)return this.groups[c];throw new Error("Cannot find token type for matched text")};function rt(){return this.value}if(s(rt,"tokenToString"),A.prototype.next=function(){var i=this.index;if(this.queuedGroup){var o=this._token(this.queuedGroup,this.queuedText,i);return this.queuedGroup=null,this.queuedText="",o}var c=this.buffer;if(i!==c.length){var m=this.fast[c.charCodeAt(i)];if(m)return this._token(m,c.charAt(i),i);var d=this.re;d.lastIndex=i;var p=tt(d,c),h=this.error;if(p==null)return this._token(h,c.slice(i,c.length),i);var m=this._getGroup(p),y=p[0];return h.fallback&&p.index!==i?(this.queuedGroup=m,this.queuedText=y,this._token(h,c.slice(i,p.index),i)):this._token(m,y,i)}},A.prototype._token=function(i,o,c){var d=0;if(i.lineBreaks){var p=/\n/g,h=1;if(o===`
6
- `)d=1;else for(;p.exec(o);)d++,h=p.lastIndex}var m={type:typeof i.type=="function"&&i.type(o)||i.defaultType,value:typeof i.value=="function"?i.value(o):o,text:o,toString:rt,offset:c,lineBreaks:d,line:this.line,col:this.col},y=o.length;if(this.index+=y,this.line+=d,d!==0?this.col=y-h+1:this.col+=y,i.shouldThrow){var _=new Error(this.formatError(m,"invalid syntax"));throw _}return i.pop?this.popState():i.push?this.pushState(i.push):i.next&&this.setState(i.next),m},typeof Symbol<"u"&&Symbol.iterator){var ne=s(function(i){this.lexer=i},"LexerIterator");ne.prototype.next=function(){var i=this.lexer.next();return{value:i,done:!i}},ne.prototype[Symbol.iterator]=function(){return this},A.prototype[Symbol.iterator]=function(){return new ne(this)}}return A.prototype.formatError=function(i,o){if(i==null)var c=this.buffer.slice(this.index),i={text:c,offset:this.index,lineBreaks:c.indexOf(`
7
- `)===-1?0:1,line:this.line,col:this.col};var d=2,p=Math.max(i.line-d,1),h=i.line+d,m=String(h).length,y=R(this.buffer,this.line-i.line+d+1).slice(0,5),_=[];_.push(o+" at line "+i.line+" col "+i.col+":"),_.push("");for(var f=0;f<y.length;f++){var O=y[f],U=p+f;_.push(I(String(U),m)+" "+O),U===i.line&&_.push(I("",m+i.col+1)+"^")}return _.join(`
8
- `)},A.prototype.clone=function(){return new A(this.states,this.state)},A.prototype.has=function(i){return!0},{compile:H,states:ie,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:et}})});var Me=oe(v=>{"use strict";var yt=v&&v.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v,"__esModule",{value:!0});v.lexer=v.states=void 0;var Tt=yt(Pe());v.states={body:{doubleapos:{match:"''",value:s(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:s(e=>e.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:s(e=>e.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:s(e=>e.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:s(e=>e.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:s(e=>e.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:s(e=>e.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:s(e=>e.substring(0,e.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};v.lexer=Tt.default.states(v.states)});var Be=oe($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.ParseError=void 0;$.parse=It;var He=Me(),ee=s(e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),"getContext"),pe=s(e=>e==="plural"||e==="select"||e==="selectordinal","isSelectType");function wt(e,t){let r="",a="";for(let l of t){let u=l.ctx.text;switch(a+=u,l.type){case"content":r+=l.value;break;case"argument":case"function":case"octothorpe":r+=u;break;default:throw new T(e,`Unsupported part in strict mode function arg style: ${u}`)}}return[{type:"content",value:r.trim(),ctx:Object.assign({},t[0].ctx,{text:a})}]}s(wt,"strictArgStyleParam");var Ot=["number","date","time","spellout","ordinal","duration"],Fe=["zero","one","two","few","many","other"],T=class extends Error{static{s(this,"ParseError")}constructor(t,r){super(He.lexer.formatError(t,r))}};$.ParseError=T;var me=class{static{s(this,"Parser")}constructor(t,r){var a,n,l,u;this.lexer=He.lexer.reset(t),this.cardinalKeys=(a=r?.cardinal)!==null&&a!==void 0?a:Fe,this.ordinalKeys=(n=r?.ordinal)!==null&&n!==void 0?n:Fe,this.strict=(l=r?.strict)!==null&&l!==void 0?l:!1,this.strictPluralKeys=(u=r?.strictPluralKeys)!==null&&u!==void 0?u:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(t,r,a){if(a[0]==="="){if(r==="select")throw new T(t,`The case ${a} is not valid with select`)}else if(r!=="select"){let n=r==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&n.length>0&&!n.includes(a)){let l=`The ${r} case ${a} is not valid in this locale`;throw new T(t,l)}}}parseSelect({value:t},r,a,n){let l={type:n,arg:t,cases:[],ctx:a};n==="plural"||n==="selectordinal"?r=!0:this.strict&&(r=!1);for(let u of this.lexer)switch(u.type){case"offset":if(n==="select")throw new T(u,"Unexpected plural offset for select");if(l.cases.length>0)throw new T(u,"Plural offset must be set before cases");l.pluralOffset=Number(u.value),a.text+=u.text,a.lineBreaks+=u.lineBreaks;break;case"case":{this.checkSelectKey(u,n,u.value),l.cases.push({key:u.value,tokens:this.parseBody(r),ctx:ee(u)});break}case"end":return l;default:throw new T(u,`Unexpected lexer token: ${u.type}`)}throw new T(null,"Unexpected message end")}parseArgToken(t,r){let a=ee(t),n=this.lexer.next();if(!n)throw new T(null,"Unexpected message end");if(a.text+=n.text,a.lineBreaks+=n.lineBreaks,this.strict&&(n.type==="func-simple"||n.type==="func-args")&&!Ot.includes(n.value)){let l=`Invalid strict mode function arg type: ${n.value}`;throw new T(t,l)}switch(n.type){case"end":return{type:"argument",arg:t.value,ctx:a};case"func-simple":{let l=this.lexer.next();if(!l)throw new T(null,"Unexpected message end");if(l.type!=="end")throw new T(l,`Unexpected lexer token: ${l.type}`);if(a.text+=l.text,pe(n.value.toLowerCase()))throw new T(n,`Invalid type identifier: ${n.value}`);return{type:"function",arg:t.value,key:n.value,ctx:a}}case"func-args":{if(pe(n.value.toLowerCase())){let u=`Invalid type identifier: ${n.value}`;throw new T(n,u)}let l=this.parseBody(this.strict?!1:r);return this.strict&&l.length>0&&(l=wt(t,l)),{type:"function",arg:t.value,key:n.value,param:l,ctx:a}}case"select":if(pe(n.value))return this.parseSelect(t,r,a,n.value);throw new T(n,`Unexpected select type ${n.value}`);default:throw new T(n,`Unexpected lexer token: ${n.type}`)}}parseBody(t,r){let a=[],n=null;for(let l of this.lexer)if(l.type==="argument")n&&(n=null),a.push(this.parseArgToken(l,t));else if(l.type==="octothorpe"&&t)n&&(n=null),a.push({type:"octothorpe",ctx:ee(l)});else{if(l.type==="end"&&!r)return a;{let u=l.value;if(!t&&l.type==="quoted"&&u[0]==="#"){if(u.includes("{")){let g=`Unsupported escape pattern: ${u}`;throw new T(l,g)}u=l.text}n?(n.value+=u,n.ctx.text+=l.text,n.ctx.lineBreaks+=l.lineBreaks):(n={type:"content",value:u,ctx:ee(l)},a.push(n))}}if(r)return a;throw new T(null,"Unexpected message end")}};function It(e,t={}){return new me(e,t).parse()}s(It,"parse")});var le={BAD_REQUEST:{status:400,title:"Bad request"},INVALID_CURSOR:{status:400,title:"Invalid cursor"},UNAUTHORIZED:{status:401,title:"Unauthorized"},FORBIDDEN:{status:403,title:"Forbidden"},NOT_FOUND:{status:404,title:"Not found"},INVALID_TRANSITION:{status:409,title:"Invalid state transition"},DELIVERY_FENCED:{status:409,title:"Delivery authorization changed"},DELIVERY_RECEIPT_FENCED:{status:409,title:"Committed receipt authorization changed"},CONFLICT:{status:409,title:"Conflict"},NOT_UNIQUE:{status:400,title:"Query matched more than one document"},VALIDATION_ERROR:{status:400,title:"Validation failed"},TOO_MANY_REQUESTS:{status:429,title:"Too many requests"},UNPROCESSABLE:{status:422,title:"Unprocessable"},NOT_IMPLEMENTED:{status:501,title:"Not implemented"},FUNCTION_NOT_FOUND:{status:404,title:"Function not found"},METHOD_NOT_ALLOWED:{status:405,title:"Method not allowed"},PAYLOAD_TOO_LARGE:{status:413,title:"Payload too large"},INTERNAL:{internal:!0,status:500,title:"Internal error"},INTERNAL_SERVER_ERROR:{internal:!0,status:500,title:"Internal error"},RPC_FAILED:{internal:!0,status:500,title:"Internal error"},COUNT_RLS_UNSUPPORTED:{status:422,title:"count() is unsupported under an RLS policy"},MASK_UNSUPPORTED:{status:422,title:"Aggregation over a masked column is unsupported"},RELATION_PREDICATE_UNSUPPORTED:{status:422,title:"Relation predicate is unsupported in a write policy"},RLS_REQUIRED:{status:403,title:"RLS policy required"},RUN_DEPTH_EXCEEDED:{internal:!0,status:500,title:"Run depth exceeded"},RUN_KIND_FORBIDDEN:{status:500,title:"Function kind may not be composed from a query"},TRANSACTION_LIMIT_EXCEEDED:{status:413,title:"Transaction limit exceeded"},MIGRATION_NOT_FOUND:{status:404,title:"Data migration not found"},MIGRATION_DRIFT:{status:409,title:"Migration drift"},MIGRATION_DESTRUCTIVE:{status:409,title:"Destructive migration not confirmed"},MIGRATION_ROOT_REQUIRED:{status:403,title:"Root admin token required for this migration"},SQL_MIGRATIONS_NOT_CONFIGURED:{status:400,title:"SQL migrations not configured"},UNIQUE_INDEX_DUPLICATES:{status:503,title:"Unique index blocked by duplicate rows"},UNKNOWN_TABLE:{status:404,title:"Unknown table"},GLOBAL_TABLE_NOT_EDITABLE:{status:400,title:"Global table is not editable"},SHARD_ERROR:{status:503,title:"Shard error"},SHARD_UNAVAILABLE:{status:503,title:"Shard unavailable"},SHARD_TIMEOUT:{status:504,title:"Shard timeout"},SHARD_HTTP_ERROR:{status:502,title:"Shard HTTP error"},SHARD_DRY_RUN_UNSUPPORTED:{status:501,title:"Shard cannot dry-run an import"},SUBSCRIPTION_PERSIST_FAILED:{status:500,title:"Subscription persist failed"},SUBSCRIPTION_SEED_FAILED:{status:500,title:"Subscription seed failed"},TOO_MANY_SUBSCRIPTIONS:{status:429,title:"Too many subscriptions"},LIVE_CONTROL_SUPERSEDED:{status:409,title:"A later live control call already applied"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},OFFLINE_QUEUE_OVERFLOW:{status:503,title:"Offline queue full, oldest write dropped"},OFFLINE_NOT_QUEUED:{status:503,title:"Offline, write not queued"},IDENTITY_MISMATCH:{status:409,title:"Session changed since the write was queued"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},PROJECT_CONFIG_INVALID:{status:500,title:"lunora.config has an unknown key, a mistyped value or no default export"},JURISDICTION_MOVE:{status:422,title:"Unacknowledged jurisdiction move"},INDEX_FIELD_NESTED_PATH:{status:500,title:"Index field is a nested path"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},X402_FACILITATOR_ERROR:{internal:!0,status:502,title:"Payment facilitator error"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},PRIVACY_COVERAGE:{status:500,title:"Privacy coverage check failed"},PRIVACY_REQUEST_OPEN:{status:409,title:"A privacy request is already open"},PRIVACY_SESSION_NOT_FRESH:{status:403,title:"Recent sign-in required"},EMAIL_DOMAIN_BLOCKED:{status:400,title:"Email domain not allowed"},EMAIL_UNDELIVERABLE:{status:400,title:"Email domain cannot receive mail"},ANALYTICS_SQL_QUERY_ERROR:{status:502,title:"Analytics SQL query error"},BROWSER_RUN_ERROR:{status:502,title:"Browser Run API error"},BROWSER_TOO_MANY_REDIRECTS:{status:502,title:"Too many redirects"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},CONFIG_INVALID:{internal:!0,status:500,title:"Payment configuration invalid"},CURRENCY_MISMATCH:{status:400,title:"Currency mismatch"},PROVIDER_ERROR:{status:502,title:"Payment provider error"},WEBHOOK_EVENT_ID_MISSING:{status:400,title:"Webhook event id missing"},WEBHOOK_SIGNATURE_INVALID:{status:400,title:"Webhook signature invalid"},WEBHOOK_TIMESTAMP_INVALID:{status:400,title:"Webhook timestamp outside tolerance"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_ROOT_REQUIRED:{status:403,title:"Root admin token required"},ADMIN_SCOPE_REQUIRED:{status:403,title:"Migrations scope required"},ADMIN_TOKEN_EXISTS:{status:409,title:"Admin token name already in use"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_MIGRATOR_UNSUPPORTED:{status:500,title:"Auth migrator cannot drive the configured database"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},AUTH_CIMD_FETCH_NOT_PUBLIC:{status:500,title:"CIMD transport needs the global_fetch_strictly_public flag"},AUTH_MCP_RESOURCE_AMBIGUOUS:{status:500,title:"MCP resource cannot be told apart from the provider's other resources"},AUTH_MCP_RESOURCE_INVALID:{status:500,title:"MCP resource missing or not an absolute URL"},MCP_STEP_UP_MISCONFIGURED:{status:500,title:"MCP step-up misconfigured"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup not configured"},BACKUP_RETENTION_NOT_CONFIGURED:{status:400,title:"Backup retention window not configured"},BACKUP_TOO_LARGE:{status:507,title:"Backup too large to assemble in a Worker"},CRON_JOBS_NOT_CONFIGURED:{status:400,title:"Cron jobs not configured"},CRON_JOB_IN_FLIGHT:{status:409,title:"Cron job is already running"},CRON_JOB_NOT_FOUND:{status:404,title:"Cron job not found"},DEPLOYMENT_PAUSED:{status:503,title:"Deployment is paused"},EXPORT_SHARD_FAILED:{status:502,title:"Export failed on one or more shards"},EXPORT_TAP_NOT_CONFIGURED:{status:400,title:"Export tap not configured"},FUNCTIONS_NOT_CONFIGURED:{status:400,title:"Functions registry not configured"},GLOBALS_NOT_CONFIGURED:{status:400,title:"Global-table introspector not configured"},ID_COLLISION:{status:409,title:"Document id already belongs to another table"},KV_NOT_CONFIGURED:{status:400,title:"KV introspector not configured"},MIGRATION_ID_REQUIRED:{status:400,title:"Migration id required"},PAUSE_INSTANCES_FAILED:{status:502,title:"Pause did not reach every scheduler instance"},PAUSE_NOT_CONFIGURED:{status:400,title:"Deployment pause not configured"},PITR_UNAVAILABLE:{status:409,title:"Point-in-time recovery unavailable"},SCHEDULER_NOT_CONFIGURED:{status:400,title:"Scheduler not configured"},STORAGE_CHECKSUM_MISMATCH:{status:400,title:"Storage checksum mismatch"},STORAGE_DELETE_NOT_CONFIGURED:{status:400,title:"Storage delete not configured"},STORAGE_DOWNLOAD_NOT_CONFIGURED:{status:400,title:"Storage download not configured"},STORAGE_NOT_CONFIGURED:{status:400,title:"Storage not configured"},STORAGE_OBJECT_NOT_FOUND:{status:404,title:"Storage object not found"},STORAGE_UPLOAD_NOT_CONFIGURED:{status:400,title:"Storage upload not configured"},STORAGE_URL_NOT_CONFIGURED:{status:400,title:"Storage signed URL not configured"},AI_UNKNOWN_IMAGE_MODEL:{status:400,title:"Unknown image model"},RAG_DIMENSION_MISMATCH:{status:409,title:"Embedding dimension mismatch"},VECTORS_NOT_CONFIGURED:{status:400,title:"Vector index introspector not configured"},VECTOR_QUERY_UNSUPPORTED:{status:400,title:"Vector index querying not enabled"},WORKFLOWS_NOT_CONFIGURED:{status:501,title:"Workflows not configured"},AUTH_AUDIT_NOT_CONFIGURED:{status:400,title:"Auth audit reader not configured"},AUTH_AUDIT_READ_FAILED:{internal:!0,status:500,title:"Auth audit read failed"},AUTH_MOVE_NOT_CONFIGURED:{status:400,title:"Auth jurisdiction move not configured"},AUTH_MOVE_TARGET_NOT_EMPTY:{status:409,title:"Pinned auth object is not empty"},AUTH_MOVE_CONFLICT:{status:409,title:"Auth copy conflict"},AUTH_MOVE_SOURCE_CHANGED:{status:409,title:"Un-pinned auth object changed since the copy"},AUTH_MOVE_SOURCE_PURGED:{status:409,title:"Un-pinned auth object already purged"},AUTH_MOVE_INCOMPLETE:{status:409,title:"Auth copy not finished"},AUTH_MOVE_FAILED:{status:500,title:"Auth jurisdiction move failed"},CRON_EXPR_INVALID:{status:500,title:"Invalid cron expression"},CRON_EXPR_NOT_STATIC:{status:500,title:"Cron expression is not statically analyzable"},CRON_JOB_FAILED:{internal:!0,status:500,title:"Cron job failed"},CRON_NAME_NOT_STATIC:{status:500,title:"Cron job name is not statically analyzable"},CRON_NON_STATIC_FN:{status:500,title:"Cron function reference is not statically analyzable"},CRON_NON_STATIC_VALUE:{status:500,title:"Cron value is not statically analyzable"},CRON_SCHEDULE_INVALID:{status:500,title:"Invalid cron schedule"},CRON_SCHEDULE_NOT_STATIC:{status:500,title:"Cron schedule is not statically analyzable"},DUPLICATE_CRON_NAME:{status:500,title:"Duplicate cron job name"},DUPLICATE_AGENT_CLASS:{status:500,title:"Duplicate agent generated class name"},DUPLICATE_AGENT_NAME:{status:500,title:"Duplicate agent name"},DUPLICATE_MIGRATION_ID:{status:500,title:"Duplicate migration id"},DUPLICATE_QUEUE_BINDING:{status:500,title:"Duplicate queue binding"},DUPLICATE_QUEUE_NAME:{status:500,title:"Duplicate queue name"},DUPLICATE_ROOM_NAME:{status:500,title:"Duplicate room name"},ROOM_NAME_NOT_LITERAL:{status:500,title:"Room name is not a string literal"},DUPLICATE_SOCKET_PATH:{status:500,title:"Duplicate socket route path"},SOCKET_AUTH_NOT_LITERAL:{status:500,title:"Socket route auth is not a literal boolean"},SOCKET_PATH_INVALID:{status:500,title:"Socket route path is not a plain URL path"},SOCKET_PATH_NOT_LITERAL:{status:500,title:"Socket route path is not a string literal"},LIVE_STREAM_DUPLICATE:{status:500,title:"Duplicate live stream id or export name"},LIVE_STREAM_NOT_EXPORTED:{status:500,title:"Live stream is not a named export"},LIVE_STREAM_NOT_LITERAL:{status:500,title:"Live stream declaration is not a literal"},LIVE_TOPIC_INVALID:{status:500,title:"Live topic name or key field is not allowed"},DUPLICATE_WORKFLOW_CLASS:{status:500,title:"Duplicate workflow generated class name"},WORKFLOW_EVENT_DUPLICATE:{status:500,title:"Duplicate workflow event type"},WORKFLOW_EVENT_NOT_LITERAL:{status:500,title:"Workflow event type is not a string literal"},MIGRATION_ID_NOT_STATIC:{status:500,title:"Migration id is not statically analyzable"},NAMESPACE_COLLISION:{status:500,title:"Function namespace collision"},PUBLISHED_FUNCTION_UNSUPPORTED:{status:500,title:"Published function cannot be registered from its declaration"},PUBLISHED_FUNCTION_VISIBILITY_UNKNOWN:{status:500,title:"Published function does not declare its visibility"},PROCEDURE_META_UNLOADED:{status:500,title:"Procedure meta is not loaded"},AI_CHAT_FAILED:{status:500,title:"Assistant turn failed"},BAD_ROW:{status:400,title:"Malformed import row"},BAD_SUBSCRIPTION_ARGS:{status:400,title:"Invalid subscription arguments"},SUBSCRIPTION_FUNCTION_REQUIRED:{status:400,title:"Subscription needs a function path"},BATCH_LIMIT_EXCEEDED:{status:400,title:"Batch limit exceeded"},CASCADE_LIMIT:{status:400,title:"Cascade limit exceeded"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},DISPATCH_UNAUTHENTICATED:{status:403,title:"Dispatch caller not authenticated"},DISPATCH_IN_PROGRESS:{status:409,title:"Dispatch already in progress"},STALE_CREDENTIAL:{status:409,title:"Stale credential"},IDENTITY_CHANGED:{status:409,title:"Socket identity changed"},IDENTITY_STALE:{status:409,title:"Socket identity stale"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},GLOBAL_SEARCH_SCORES_UNSUPPORTED:{status:400,title:"collectWithScores() is unsupported on a global table"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},FORBIDDEN_TOPIC:{status:403,title:"Live topic publish forbidden"},GLOBAL_DRY_RUN_UNSUPPORTED:{status:400,title:"Global table dry run not supported"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},INVALID_SCHEDULE_ID:{status:400,title:"Invalid schedule id"},RATE_LIMITED:{status:429,title:"Rate limited"},REPLICA_NOT_READY:{status:421,title:"Replica not caught up"},REPLICA_READ_ONLY:{status:421,title:"Replica is read-only"},SEARCH_INDEX_BUILDING:{status:503,title:"Search index is still building"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_MEMORY_TABLE:{status:400,title:"Shape over a memory table is unsupported"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},SHAPE_RELATION_PREDICATE:{status:400,title:"Shape filtered by a relation is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},WIRE_DECODE_FAILED:{status:502,title:"Could not decode a server frame"},WIRE_ENCODE_FAILED:{status:500,title:"Could not encode a return value"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},CDC_LOG_TRIMMED:{status:409,title:"CDC log trimmed"},CDC_TIMELINE_FORKED:{status:409,title:"CDC timeline forked"},CDC_PAYLOAD_COMPACTED:{status:409,title:"CDC payloads compacted"},EXPIRED:{status:404,title:"Session expired"},GLOBAL_TRANSACTION_UNSUPPORTED:{status:500,title:"Global transaction unsupported by driver"},LIVE_CONNECTION_LIMIT:{status:503,title:"Live connection limit reached"},LIVE_CONNECTION_NOT_FOUND:{status:404,title:"Live connection not found"},LIVE_STREAMS_UNSUPPORTED:{status:501,title:"Live streams are not served by this worker"},NESTED_TRANSACTION:{internal:!0,status:500,title:"Nested transaction"},OUT_OF_ORDER:{status:409,title:"Out-of-order mutation"},SHAPE_GLOBAL_TOO_LARGE:{status:413,title:"Global shape too large"},SHAPE_NOT_FOUND:{status:404,title:"Shape not found"},SHAPE_REQUIRES_CDC:{status:409,title:"Shape requires change-data-capture"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},STREAM_ID_IN_USE:{status:409,title:"Stream id already in use"},STREAM_IDLE:{status:504,title:"Stream went idle"},STREAM_INTERRUPTED:{status:503,title:"Durable stream interrupted"},STREAM_TOO_LONG:{status:507,title:"Durable stream exceeded its chunk ceiling"},SUBSCRIPTION_RESULT_TOO_LARGE:{status:413,title:"Subscription result too large"},TOKEN_EXPIRED:{status:401,title:"Authentication token expired"},TOO_MANY_LIVE_TOPICS:{status:429,title:"Too many live topics"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},TOO_MANY_WHISPER_TOPICS:{status:429,title:"Too many whisper topics"},UNKNOWN_ADMIN_OP:{status:404,title:"Unknown admin operation"},SOCKET_TAG_BUDGET_EXCEEDED:{status:400,title:"Socket tag budget exceeded"},RELAY_CANNOT_SEED:{status:500,title:"Relay cannot seed"},RELAY_MISCONFIGURED:{status:500,title:"Relay misconfigured"},RELAY_SEED_FAILED:{status:502,title:"Relay seed failed"},RELAY_SHAPE_UNROUTABLE:{status:500,title:"Relay shape unroutable"},MISCONFIGURED:{internal:!0,status:500,title:"Worker misconfigured"},LUNORA_RUNTIME_UNAVAILABLE:{status:500,title:"Lunora runtime unavailable"},INTERNAL_ERROR:{internal:!0,status:500,title:"Internal error"},BROWSER_TIMEOUT:{status:504,title:"Browser operation timed out"},CLIENT_CLOSED:{status:400,title:"Client is closed"},HTTP_STREAM_BAD_CHUNK:{status:502,title:"Malformed HTTP stream chunk"},HTTP_STREAM_CALLBACK:{status:500,title:"HTTP stream callback threw"},HTTP_STREAM_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{status:502,title:"HTTP stream response has no body"},HTTP_STREAM_STATUS:{status:502,title:"HTTP stream request failed"},HTTP_STREAM_TRANSPORT:{status:502,title:"HTTP stream transport error"},STREAM_BACKPRESSURE:{status:429,title:"Stream backpressure"},STREAM_DISCONNECTED:{status:503,title:"Stream disconnected"},STREAM_QUEUE_OVERFLOW:{status:429,title:"Stream queue overflow"},UNKNOWN_MUTATION_FN:{status:404,title:"Unknown mutation function"},LOCAL_DEPENDENCY_MISSING:{status:500,title:"Required local tool not found"}},ue=s(e=>Object.hasOwn(le,e)?le[e]:void 0,"s");var Ne=Symbol.for("@lunora/errors/LunoraError"),ce=class e extends Error{static{s(this,"s")}static[Symbol.hasInstance](t){return this!==e?Function.prototype[Symbol.hasInstance].call(this,t):typeof t=="object"&&t!==null&&t[Ne]===!0}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;why;constructor(t,r,a={}){let n=ue(t);super(r??t,a.cause===void 0?void 0:{cause:a.cause}),this.name=a.name??"LunoraError",this.hint=a.hint,this.title=a.title??n?.title,this.loc=a.location,this.code=t,this.status=a.status??n?.status??500,this.docsUrl=a.docsUrl,this.data=a.data,this.why=a.why,Object.defineProperty(this,Ne,{value:!0}),a.internal!==void 0&&Object.defineProperty(this,"internal",{value:a.internal}),a.headers!==void 0&&Object.defineProperty(this,"headers",{value:a.headers})}};var k="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",j="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/",it=/string or blob too big/iu,ve=["Another write changed this row while your mutation was running (optimistic concurrency conflict).","","Re-read the row and retry the mutation with the fresh value. Lunora serializes a DO's mutations, so a persistent conflict usually means the handler conflicts **with itself** (e.g. a trigger or cascade touching the same row) \u2014 split that work rather than adding a retry loop."],de={DELIVERY_FENCED:"The operation may have committed. Retry with the same transport key; a committed result from an older authority epoch returns DELIVERY_RECEIPT_FENCED. Do not automatically retry with a new transport key.",DELIVERY_RECEIPT_FENCED:"The operation committed, but its stored result belongs to an older authority epoch. Do not automatically retry with a new transport ID. Recover through the application's durable operation key under current authorization.",CONFLICT:ve,INVALID_CURSOR:"The page cursor was refused: its format prefix is one the engine no longer reads, its payload is not one the server minted, or it carries fewer sort keys than the query orders by now. The engine bumps the prefix whenever a format change would otherwise read old cursors as the wrong rows, so this usually follows a deploy. `usePaginatedQuery` restarts the feed from its first page when a page fails with this code; a hand-written pager should do the same rather than retry the cursor.",GLOBAL_TRANSACTION_UNSUPPORTED:"A `.global()` write commits its row and companion rows in one transaction. Pass a postgres.js client that has `begin()`, or a mysql2 pool (`createPool`) rather than a single connection.",NOT_UNIQUE:["`.unique()` matched more than one document \u2014 it expects the query to identify at most one row.","","- If several matches are legitimate, use `.first()` (take one) or `.collect()` (take all) instead.","- Otherwise tighten the query (e.g. filter on a unique/indexed field) so it can only match one row."],RLS_REQUIRED:["This table is secure-by-default: it has no `.public()` marker and no RLS policy resolved for the caller, so the read fails closed.","","Add a read policy with `.rls(...)`, or mark the table `.public()` if it is intentionally world-readable."],TRANSACTION_LIMIT_EXCEEDED:["A single mutation may only read and write a bounded amount before it is stopped.","","Narrow the read with an index (`.withIndex(...)`) instead of scanning the table, or split the write across several mutations \u2014 for a large backfill use `defineMigration` + `lunora migrate up`, which batches and checkpoints for you.","","The ceilings are deliberately conservative \u2014 they exist to stop one request taking down the whole shard. A deployment that genuinely needs bigger transactions can raise them by overriding the `transactionLimits()` seam on its generated shard class.","","A transaction that reaches 80% of a ceiling without crossing it logs one `warn` line (event `lunora.transaction.near_limit`) naming the limit, so a function that only gets close on development data shows up before production data pushes it over. A single read or write that jumps past the ceiling from below 80% fails without that warning."],MIGRATION_DRIFT:["An applied SQL migration is never re-run, so the runner stopped before applying anything.","","- **Its text changed after it ran:** revert the edit and put the change in a new migration. If the edit is inert (a comment, whitespace, line endings), record the new hash with the `UPDATE` the message prints.","- **Tracking rows predate versions and match no migration:** set each row's `version` with the `UPDATE` the message prints, so the runner can tell what already ran."],MIGRATION_DESTRUCTIVE:["A pending SQL migration drops, renames, truncates or replaces, and nothing in it says that is intended, so the runner stopped before applying anything.","","If it is intended, put a `-- lunora:allow-destructive` line comment on its own line before the statement and run again. Only migrations that have not run yet are checked, so never add the comment to one that already ran: that changes its hash and is refused as drift."],UNIQUE_INDEX_DUPLICATES:["The index was not built, so requests to its store are refused until it is.","","Make one row keep each key. For a shard table, write a `defineMigration` in `lunora/migrations.ts` that deletes or merges the duplicates, deploy it, then run `lunora migrate up <id>` with that migration's id; the `lunora-migration-helper` skill covers the pattern. A `.global()` table lives in your SQL database, not a shard, so `defineMigration` does not reach it: delete or merge the duplicate rows directly in the database. Either way the index build is retried on its own, so no second deploy is needed."],OFFLINE_QUEUE_OVERFLOW:"The client held `offlineQueue.maxItems` writes (1000 by default) while offline, so it dropped the oldest one to make room and rejected it with this code. The dropped write was never sent. Raise `maxItems` on the `LunoraClient`, or stop issuing writes while the connection is down; `client.onMutationSettled` reports every dropped write, including one restored after a reload. See [offline-first](/docs/concepts/offline-first).",SUBSCRIPTION_SEED_FAILED:"The query behind a subscription threw on its first run, and the error was not a `LunoraError` with a non-internal code, so its message was redacted before it reached the client. The shard logs the real error with `console.error`, prefixed `[@lunora/do] subscription seed failed for <function path>`: read it with `lunora logs` (or `wrangler tail`) in production, or in the `lunora dev` terminal locally. Studio's Logs tab shows only the redacted entry. A query that throws a `LunoraError` with a non-internal code keeps its own code and message instead; an internal-coded one arrives under its own code rather than this one, with its message redacted and the real error logged the same way.",OFFLINE_NOT_QUEUED:"A mutation sent with `onlineOnly: true` found its connection down or reconnecting (the shard had connected before), or, on a shard that has never connected, its request failed on the wire. It was refused instead of queued. Nothing was persisted or replayed; issue the call again once the connection is back. See [keeping a write off the queue](/docs/concepts/offline-first#keeping-a-write-off-the-queue).",IDENTITY_MISMATCH:["A write queued offline was replayed on a session that now belongs to someone else (a sign-out, or another user's sign-in, while it waited), so the worker refused it rather than commit it as them.","","`@lunora/client` re-resolves the session on this refusal and settles the write itself. If every replay is refused while the same user stays signed in, your worker's `resolveIdentity` returns a different `userId` than better-auth's `user.id`, or the RPC request carries no session cookie."],JURISDICTION_MOVE:["The schema declares `.jurisdiction(...)` and the project has DO-backed auth (`.auth({ namespace })`). Pinning the auth object to the jurisdiction resolves it to a new, empty one: every user, account and session stays in the unpinned object until copied across. Voice sessions are pinned without an acknowledgement: they store nothing, and their transcripts are rows in the already-pinned shards.","",'Acknowledge with `.jurisdiction("eu", { pinAuth: true })` and deploy, then copy the auth tables across with the `__lunora_admin__:copyAuthToJurisdiction` admin op and, once the counts check out, purge the unpinned copy with `__lunora_admin__:purgeUnpinnedAuth` (see [Pinning auth and voice](/docs/concepts/data-residency#pinning-auth-and-voice)). For D1-mode auth the acknowledgement changes nothing.'],INDEX_FIELD_NESTED_PATH:"Indexes cover top-level columns only. Denormalise the nested value into its own column, index that, and keep it in sync with a table `.triggers()` beforeInsert/beforeUpdate.",EMAIL_DOMAIN_BLOCKED:["This address's domain is on the disposable/throwaway blocklist (or your configured deny-list).","","Sign up with a permanent mailbox. To tune the policy, pass `blockDisposable` / `allowDomains` / `denyDomains` in the `EmailGateConfig` you hand `assertEmailAllowed` / `classifyEmail` / `emailGateMiddleware` (`@lunora/auth/email-guard`)."],EMAIL_UNDELIVERABLE:["The address's domain publishes no MX (or fallback A/AAAA) records, so it can't receive mail.","","Check for a typo in the domain. MX verification is opt-in (`mx: true`) and needs DNS \u2014 leave it off on the edge path if DNS is unavailable."],AUTH_MIGRATOR_UNSUPPORTED:["better-auth migrates only through its Kysely adapter, so `ensureMigrated` / `compileMigrationsSql` need the raw D1 binding as `database` \u2014 a custom adapter (`lunoraD1Adapter`, `lunoraAuthAdapter`, `lunoraDoAdapter`) cannot be migrated through, and neither can an absent `database`.","","Build a SECOND, migration-only instance over the raw binding \u2014 `createMigrationAuth({ ...options, database: env.DB })` (from `@lunora/auth/migrate`) \u2014 and hand that one to `ensureMigrated`. Keep the adapter on the instance that serves requests: the adapter exists to dodge a dev-runner hang in `$context`, which the migration instance never resolves.","","To compile the SQL off-platform (`compileMigrationsSql`), diff against an empty local database \u2014 `new DatabaseSync(':memory:')` from `node:sqlite` \u2014 rather than passing no `database` at all."],AUTH_CIMD_FETCH_NOT_PUBLIC:'Add "global_fetch_strictly_public" to "compatibility_flags" in wrangler.jsonc, so CIMD metadata fetches cannot reach private addresses. `lunora doctor` reports it as `cimd-fetch-not-strictly-public`.',AUTH_MCP_RESOURCE_AMBIGUOUS:'Use `mcp` from "@lunora/auth/plugins" (not `@better-auth/mcp`) and pass the plugin object as is: it records its `resource`, which the worker needs to serve the protected-resource metadata when the provider names several resources.',AUTH_MCP_RESOURCE_INVALID:"Pass `resource` to `requireMcpAuth` (and `mcp()`) as the absolute URL of the MCP route, e.g. `https://app.example.com/mcp`: issued tokens are audience-bound to it.",MCP_STEP_UP_MISCONFIGURED:"Give `createAuthedMcpFetchHandler`'s `stepUp` a non-empty `scope` (such as `lunora:write`) and a `challenge` (`createInsufficientScopeError` from `@lunora/auth/plugins`), or leave `stepUp` out.",BACKUP_RETENTION_NOT_CONFIGURED:["`lunora backup prune` removes snapshots past the retention window, and this worker has no window: set `backupRetain` (how many to keep) and `backupCron` (which decides whose snapshots retention owns) on `createWorker`.","","Nothing was deleted. A default is deliberately not invented here \u2014 retention deleting on its own is exactly what this command exists to replace."],BACKUP_TOO_LARGE:["The scheduled backup is assembled inside the Worker isolate, so it caps the snapshot it will build. Nothing was written.","","The cap is on the NDJSON, not on peak memory: the export fan-out resolves every shard's rows before the first row is encoded, so a snapshot under the cap can still exhaust the isolate. It is set well below the isolate's limit for that reason.","","Narrow the snapshot with `backupTables`, or take this backup off-platform with `lunora backup create --bucket`, which runs on a machine rather than in an isolate. Backing up more often does not help \u2014 every run is a full snapshot."],EXPORT_SHARD_FAILED:["One or more shards failed to export, so the snapshot would have been short. Nothing is written when this fires \u2014 a partial export must never be mistaken for a complete one.","","The message names each failed shard key and its error. Re-run the export once those shards are reachable; a shard that fails repeatedly is usually over the per-request memory budget, which `backupTables` narrows."],ID_COLLISION:["The imported row carries an `_id` that is already held by a DIFFERENT table in this shard. Ids are per-table, so inserting it would leave two tables claiming one id and make a later lookup resolve to whichever one it reached first.","","This is reported per row rather than aborting the import: the remaining rows still apply. Re-mint the id on the source side, or import that table into a shard that does not already hold it.","","Only shard tables raise it. A `.global()` table names its table on every by-id call, so the same id in two global tables is two separate rows and the import accepts it."],STORAGE_CHECKSUM_MISMATCH:["The upload body did not match the declared `expectedSize` or `expectedSha256`, so nothing was written \u2014 this check fails closed.","","Re-read the bytes from the source export and retry the transfer. A persistent mismatch means the source blob is corrupt or truncated; fix the export rather than bypassing the check."],STORAGE_DOWNLOAD_NOT_CONFIGURED:["`GET /_lunora/admin/storage/object` needs a `storageDownload` function on the worker. The generated app worker wires it up; a hand-written `createWorker({ ... })` has to pass `(key, opts) => pick(opts?.bucket).download(key)` \u2014 forwarding `opts.bucket` to the right bucket, and wrapping rather than passing `createStorage(...).download` itself, whose second parameter is a byte range.","","Without it a bucket-backed `lunora backup restore --bucket` cannot read the snapshot. The object is still readable out of band with `wrangler r2 object get`."],RAG_DIMENSION_MISMATCH:["A stored vector and the query embedding have different widths, so they cannot be compared.","","This is what changing a RAG index's `embeddingModel` (or a provider's `dimensions` option) without reindexing looks like. Either put the previous model back, or reindex the namespace under the new one \u2014 bump `embeddingModelVersion` so the index rebuilds instead of mixing widths."],AUTH_MOVE_NOT_CONFIGURED:"The copy needs DO-backed auth (`.auth({ namespace })`) pinned with `.jurisdiction(\u2026, { pinAuth: true })`, and the auth object's `internalSecret` set.",AUTH_MOVE_TARGET_NOT_EMPTY:"The pinned auth object holds users the copy did not write (someone signed up there), so copying into it would merge two user bases. Pass `force: true` to copy anyway: a copied row that collides with one of the pinned object's rows is left out and counted under `conflicts`.",AUTH_MOVE_CONFLICT:"A copied row has the same key or unique value (such as an email) as a row the pinned auth object holds on its own, or the pinned object changed a row the source changed too. Nothing from that page was written. Pass `force: true` to keep the pinned object's rows and count the collisions under `conflicts`.",AUTH_MOVE_SOURCE_CHANGED:"The un-pinned auth object changed after the copy read it (an update, a delete, or a new row), for example during a gradual rollout or a rollback. Run the copy again: it reconciles the changed tables. Then purge.",AUTH_MOVE_SOURCE_PURGED:"The un-pinned auth object was already purged. Its tables may exist again (a rollback served requests there), but they hold only rows written since, so the copy refuses rather than read them as deletions and remove the pinned object's users. Nothing is left to copy.",AUTH_MOVE_INCOMPLETE:"Run `__lunora_admin__:copyAuthToJurisdiction` until it answers `done: true`, check the per-table counts, then purge.",AUTH_MOVE_FAILED:"The message names the step, the table and the class of the SQLite error; the auth object's log has the full error. The copy resumes where it stopped once the cause is fixed.",DISPATCH_UNAUTHENTICATED:"The scheduler could not authenticate to the worker. Check that `LUNORA_SCHEDULER_SECRET` matches on both sides, or that `LUNORA_ADMIN_TOKEN` is set and current. A signed dispatch is also refused when the scheduler's and the worker's clocks differ by more than five minutes.",DISPATCH_IN_PROGRESS:"A dispatch with this idempotency id is still running on the shard. Retry it; once the first attempt settles the same id is served from the replay cache.",TOKEN_EXPIRED:["The caller's credential verified but its expiry has passed. The worker refuses an HTTP call with this code before it runs; a shard drops a socket with close code `4001` and the same code.","","It is a refusal of the credential, not of the call: `@lunora/client` holds a queued write, fires `onTokenExpired`, and re-sends it after `setAuthToken`. The held write survives the refresh only if you pass the same `subject` (the user id) with the new token, `setAuthToken(freshToken, user.id)`; without one a refresh reads as a user switch and the write is rejected `OFFLINE_IDENTITY_CHANGED`. Under a cookie session there is no token to replace: renew the cookie and the write is re-sent on a backoff. The worker can only tell expired from anonymous if your `resolveIdentity` returns the identity with its past `exp` (or `expiresAtMs`), or throws a `LunoraError` with this code. Returning `null` runs the call anonymous."],TOO_MANY_WHISPER_TOPICS:"Reuse a stable set of whisper topic names, or reconnect \u2014 the per-socket verdict memo is in-memory, so a new connection starts empty. Leaving a topic does not free its entry.",HTTP_STREAM_NO_BODY:["The `fetch` implementation resolved with a response that exposes neither a `body` stream nor a `text()` read \u2014 a broken `fetch` substitute, not a runtime limitation.","A response with no `body` stream that can still be read as text (React Native's `whatwg-fetch` polyfill) is buffered through `text()` instead and never raises this code. Check the `fetch` override passed to the client or the `httpStream` call."],LOCAL_DEPENDENCY_MISSING:["The command Lunora tried to run is not on your PATH, so nothing ran.","","Install it (or put it on PATH) and retry \u2014 `wrangler` ships as a dependency of a Lunora app, so `pnpm install` usually fixes that one; `git` and `docker` are installed separately."]},De=s(e=>Object.hasOwn(de,e)?de[e]:void 0,"m"),Ce=[{body:["A single row exceeded the storage engine's per-row ceiling \u2014 2 MB on a Durable Object's SQLite, and 2,000,000 bytes on D1.","","The limit is on the STORED bytes, which are UTF-8: a document of multi-byte text (CJK, emoji) costs up to 3x its character count. `v.bytes()` and `v.bigint()` columns cost more again on a shard-local table, where the row stores both a SQL-comparable projection and the original.","","Keep the large payload out of the row and store a reference to it:","","```ts","const key = `uploads/${crypto.randomUUID()}`;","await ctx.storage.uploads.put(key, bytes);",'await ctx.db.insert("documents", { storageKey: key, title });',"```","","R2 has no practical object-size ceiling, and the row stays small enough to read, index, and replicate."].join(`
9
- `),header:"Row too large for the storage engine",id:"lunora-row-too-big",test:s(e=>it.test(e),"test")},{body:["Lunora codegen couldn't find a schema to generate from.","","Create `lunora/schema.ts` exporting a `defineSchema(...)` call:","","```ts",'import { defineSchema, defineTable, v } from "@lunora/server";',"","export default defineSchema({"," messages: defineTable({ body: v.string() }),","});","```","","Or run `lunora init` to scaffold Lunora (a sample `lunora/schema.ts` included) into your app."].join(`
10
- `),header:"No Lunora schema found",id:"lunora-schema-missing",test:s(e=>e.includes("defineSchema() not found")||e.includes("schema.ts not found at"),"test")},{body:["`defineSchema(...)` must be called with an **inline object literal** mapping table names to `defineTable(...)`:","","```ts","export default defineSchema({"," todos: defineTable({ title: v.string(), done: v.boolean() }),","});","```","","Codegen reads the schema statically, so it can't follow a variable or a spread \u2014 pass the object literal directly."].join(`
11
- `),header:"`defineSchema()` needs an inline object literal",id:"lunora-schema-not-object-literal",test:s(e=>e.includes("defineSchema() expects an object literal"),"test")},{body:["This table name collides with a built-in `ctx.db` member, so the generated client can't expose it.","","Rename the table to anything that isn't a `ctx.db` member (the error names the one it hit) \u2014 e.g. `userAccounts` instead of `insert`, or `pageViews` instead of `count`."].join(`
12
- `),header:"Table name is reserved",id:"lunora-table-reserved",test:s(e=>e.includes("is reserved")&&e.includes("ctx.db"),"test")},{body:["Two tables resolve to the same name \u2014 usually a base table and a schema **extension** both defining it.","","Rename one of them, or drop the duplicate from the extension. Each table name must be unique across `defineSchema(...)` and every `.extend(...)`."].join(`
13
- `),header:"Duplicate table name",id:"lunora-table-duplicate",test:s(e=>e.includes("already exists")&&e.includes(".extend("),"test")},{body:['`.jurisdiction(...)` accepts only a **string literal** of `"eu"`, `"us"`, or `"fedramp"`:',"","```ts",'defineSchema({ /* \u2026 */ }).jurisdiction("eu");',"```"].join(`
14
- `),header:"Invalid `.jurisdiction(...)` value",id:"lunora-jurisdiction",test:s(e=>e.includes("unknown jurisdiction")||e.includes("jurisdiction")&&e.includes('"eu", "us", or "fedramp"'),"test")},{body:["The `unique` flag on an index must be a **literal** `true` or `false`, not a computed value \u2014 codegen needs to read it statically:","","```ts",'defineTable({ email: v.string() }).index("by_email", ["email"], { unique: true });',"```"].join(`
15
- `),header:"`unique` must be a literal",id:"lunora-unique-literal",test:s(e=>e.includes("must be a literal")&&e.includes("unique"),"test")},{body:["A declared container/workflow class isn't re-exported by your worker entry, so `wrangler deploy` would reject it.","","Add the generated re-export shown in the error to your worker entry (e.g. `src/index.ts`):","","```ts",'export * from "./lunora/_generated/containers";',"```"].join(`
16
- `),header:"Binding not exported by your worker entry",id:"lunora-worker-entry-export-gap",test:s(e=>e.includes("not exported by your worker entry"),"test")},{body:["A row with the same value already exists in a `unique` index.","","- If you meant to upsert, use `ctx.db.<table>().upsert(...)` (or `.patch(...)` an existing row) instead of `.insert(...)`.",`- Otherwise pick a value that isn't already taken, and consider surfacing a friendly "already exists" message to the user.`].join(`
17
- `),header:"Unique constraint violation",id:"lunora-runtime-unique",test:s(e=>e.includes("unique constraint violation on"),"test")},{body:ve.join(`
18
- `),header:"Optimistic concurrency conflict",id:"lunora-runtime-occ",test:s(e=>e.includes("optimistic concurrency conflict"),"test")}],he=[{causes:"the origin returned an empty, unknown, or malformed response Cloudflare couldn't interpret (often an origin crash or an oversized response header)",code:"520",docsUrl:k,family:"5xx",fix:"check your origin's logs for a crash, ensure it returns a valid HTTP response, and keep response headers under the size limit",summary:"Cloudflare got an unknown/empty response from your origin web server.",title:"Web server returns an unknown error"},{causes:"the origin refused the connection \u2014 the web server is down, or a firewall is blocking Cloudflare's IP ranges",code:"521",docsUrl:k,family:"5xx",fix:"confirm the origin process is running and allowlist Cloudflare's published IP ranges in your firewall/security groups",summary:"Cloudflare could not connect to your origin because it refused the connection.",title:"Web server is down"},{causes:"Cloudflare could not establish a TCP connection to the origin in time \u2014 the origin is overloaded, a firewall is dropping packets, or the origin IP is wrong",code:"522",docsUrl:k,family:"5xx",fix:"verify the origin is reachable and not overloaded, and that the DNS record points at the correct origin IP",summary:"The connection to your origin timed out before it was established.",title:"Connection timed out"},{causes:"Cloudflare cannot route to the origin at all \u2014 a bad DNS record, an origin IP that changed, or invalid routing",code:"523",docsUrl:k,family:"5xx",fix:"verify the DNS A/AAAA record points at a reachable origin IP and that no upstream network is blocking Cloudflare",summary:"Cloudflare could not reach your origin server.",title:"Origin is unreachable"},{causes:"Cloudflare made a TCP connection but the origin did not return an HTTP response within 100 seconds \u2014 a slow handler or long-running request",code:"524",docsUrl:k,family:"5xx",fix:"speed up the slow origin handler, or move long work off the request path into a background job (a Durable Object, Queue, or Workflow)",summary:"Cloudflare connected to your origin but it did not respond in time.",title:"A timeout occurred"},{causes:"the TLS handshake between Cloudflare and the origin failed \u2014 a missing/invalid origin certificate, or a cipher/SNI mismatch under Full (Strict) SSL",code:"525",docsUrl:k,family:"5xx",fix:"install a valid certificate on the origin and align your Cloudflare SSL/TLS mode with the origin's certificate setup",summary:"The SSL handshake with your origin failed.",title:"SSL handshake failed"},{causes:"Cloudflare could not validate the origin's certificate under Full (Strict) SSL \u2014 it is expired, self-signed, or issued for the wrong hostname",code:"526",docsUrl:k,family:"5xx",fix:"install a valid, publicly-trusted certificate on the origin (or use a Cloudflare Origin CA cert), matching the request hostname",summary:"Cloudflare could not validate your origin's SSL certificate.",title:"Invalid SSL certificate"},{causes:"a DNS record points at a Cloudflare IP or another prohibited address instead of your real origin",code:"1000",docsUrl:j,family:"1xxx",fix:"point the DNS record at your real origin IP, not a Cloudflare-owned or loopback address",summary:"DNS points to a prohibited IP.",title:"DNS points to prohibited IP"},{causes:"Cloudflare could not resolve the requested hostname \u2014 a Worker fetched an unresolvable host, or a DNS record is misconfigured",code:"1001",docsUrl:j,family:"1xxx",fix:"check the hostname you're requesting and the DNS records for the zone resolve to a valid origin",summary:"Cloudflare could not resolve the origin DNS.",title:"DNS resolution error"},{causes:"a Worker or DNS record targets a restricted IP (for example a Cloudflare-owned or loopback address)",code:"1002",docsUrl:j,family:"1xxx",fix:"change the Worker fetch target or DNS record to a valid, non-restricted origin address",summary:"DNS points to a prohibited IP (Worker/restricted).",title:"DNS points to a prohibited IP"},{causes:"the visitor's IP was blocked by an IP Access Rule, WAF rule, or security configuration on the zone",code:"1006",docsUrl:j,family:"1xxx",fix:"review the zone's Firewall/WAF and IP Access Rules to see why the address was banned, and adjust if it was blocked in error",summary:"Access denied: the visitor's IP has been banned.",title:"Access denied: your IP has been banned"},{causes:"your Worker threw an unhandled JavaScript exception during the request",code:"1101",docsUrl:j,family:"1xxx",fix:"reproduce with `wrangler tail` (or the Workers Logs / Studio Logs panel) to get the stack trace, then handle the throwing code path",summary:"A Worker threw a JavaScript exception.",title:"Worker threw a JavaScript exception"},{causes:"the Worker used more CPU time than a single invocation is allowed \u2014 usually a hot loop or heavy synchronous work",code:"1102",docsUrl:j,family:"1xxx",fix:"reduce per-request CPU (optimize hot loops, avoid heavy synchronous work) or offload the heavy work to a Durable Object, Queue, or Workflow",summary:"A Worker exceeded its CPU-time resource limit.",title:"Worker exceeded resource limits"}],fe=s(e=>e!==void 0&&e>="0"&&e<="9","s"),nt=s((e,t)=>{for(let r=e.indexOf(t);r!==-1;r=e.indexOf(t,r+t.length))if(!fe(e[r-1])&&!fe(e[r+t.length]))return!0;return!1},"g"),ot=s((e,t)=>{for(let r of[`error ${t}`,`error: ${t}`])for(let a=e.indexOf(r);a!==-1;a=e.indexOf(r,a+r.length))if(!fe(e[a+r.length]))return!0;return!1},"w"),lt=/error|cloudflare/iu,Re=s(e=>({body:[e.summary,"",`**Likely cause:** ${e.causes}.`,"",`**Fix:** ${e.fix}.`,"",`See [Cloudflare's ${e.family} error docs](${e.docsUrl}).`].join(`
19
- `),header:`Cloudflare Error ${e.code}: ${e.title}`,id:`cloudflare-error-${e.code}`}),"c"),Ue=s(e=>{if(!lt.test(e))return;let t=e.toLowerCase(),r=t.includes("error"),a=t.includes("cloudflare");if(r){for(let n of he)if(ot(t,n.code))return Re(n)}if(a){for(let n of he)if(nt(t,n.code))return Re(n)}},"y"),ut=s(e=>(typeof e=="string"?e:e.join(`
20
- `)).split(`
21
- `).filter(t=>!t.startsWith("```")).join(`
22
- `).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),"T"),X=s(e=>{for(let t of Ce)if(t.test(e))return{body:t.body,header:t.header,id:t.id}},"d"),ct=s(e=>X(e)??Ue(e),"v"),J=s(e=>{if(typeof e=="string")return X(e)?.body;if(e.hint!==void 0)return e.hint;if(e.code!==void 0){let t=De(e.code);if(t!==void 0)return t}return e.message===void 0?void 0:X(e.message)?.body},"x");var dt="A mutation sent with `onlineOnly: true` found its connection down or reconnecting (the shard had connected before), or, on a shard that has never connected, its request failed on the wire. It was refused instead of queued. Nothing was persisted or replayed; issue the call again once the connection is back. See [keeping a write off the queue](/docs/concepts/offline-first#keeping-a-write-off-the-queue).",ht=["The `fetch` implementation resolved with a response that exposes neither a `body` stream nor a `text()` read \u2014 a broken `fetch` substitute, not a runtime limitation.","A response with no `body` stream that can still be read as text (React Native's `whatwg-fetch` polyfill) is buffered through `text()` instead and never raises this code. Check the `fetch` override passed to the client or the `httpStream` call."];var ft=s(e=>{if(typeof e=="string")return[e];if(!Array.isArray(e))return;let t=e.filter(r=>typeof r=="string");return t.length>0?t:void 0},"a"),Le=s(e=>{if(e!==void 0)return typeof e=="string"?e:e.join(`
23
- `)},"s"),pt=new Set(["ADMIN_FORBIDDEN","FORBIDDEN","UNAUTHORIZED"]),ur=s((e,t,r,a,n)=>{switch(t){case"action":return e.action(r,a,n);case"mutation":return e.mutation(r,a,{...n,onlineOnly:!0});default:return e.query(r,a,n)}},"p"),cr=s(e=>({__lunoraRef:e}),"m"),dr=s(e=>{let t=e.trim();return t===""?{}:{shardKey:t}},"h"),hr=s(e=>e instanceof Error?e.message:String(e),"b"),mt=s(e=>{if(e===null||typeof e!="object"||!("code"in e))return;let{code:t}=e;return typeof t=="string"?t:void 0},"u"),fr=s(e=>{let t=mt(e);return t!==void 0&&pt.has(t)},"B"),pr=s(e=>{if(typeof e=="string")return Le(J(e));if(e===null||typeof e!="object")return;let{code:t,hint:r,message:a}=e;return Le(J({code:typeof t=="string"?t:void 0,hint:ft(r),message:typeof a=="string"?a:void 0}))},"w"),mr=s(e=>{if(e===null||typeof e!="object"||!("docsUrl"in e))return;let t=e.docsUrl;if(typeof t=="string")try{let{protocol:r}=new URL(t);return r==="http:"||r==="https:"?t:void 0}catch{return}},"T"),xe=s(e=>{if(e==null)return"\u2014";if(e<1024)return`${e.toString()} B`;let t=["KB","MB","GB","TB"],r=e/1024,a=0;for(;r>=1024&&a<t.length-1;)r/=1024,a+=1;return`${r.toFixed(1)} ${t[a]??"TB"}`},"c"),gt=s((e,t)=>typeof t=="bigint"?t.toString():t instanceof ArrayBuffer||ArrayBuffer.isView(t)?`<bytes: ${xe(t.byteLength)}>`:t,"d"),gr=s(e=>typeof e=="bigint"?e.toString():e,"S"),_r=s(e=>{if(e==null)return"";switch(typeof e){case"bigint":case"boolean":case"number":return e.toString();case"string":return e;case"symbol":return e.toString();default:return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?`<bytes: ${xe(e.byteLength)}>`:JSON.stringify(e,gt)}},"A"),_t=s((e,t)=>{e.catch(r=>{t?.(r)})},"g"),Et=s(e=>{if(e!==void 0&&e!=="")return e;let t=globalThis.location;return t?.origin!==void 0&&t.origin!==""?t.origin:"http://localhost:5173"},"l"),Er=s(e=>{let t=Et(e);for(;t.endsWith("/");)t=t.slice(0,-1);return t},"D"),yr=s(e=>{let t="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return t===void 0?!1:(_t(t.writeText(e)),!0)},"N"),Tr=s((e,t="")=>{if(e==null||e==="")return t;let r=new Date(e);return Number.isNaN(r.getTime())?String(e):r.toLocaleString()},"O");function br(...e){return Se(be(e))}s(br,"m");var je=Ae(Be(),1);var N=class extends Error{static{s(this,"DateFormatError")}constructor(t,r,a){super(t),this.token=r,this.type=a||"error"}},Ge=s(e=>e<4?"short":e===4?"long":"narrow","alpha"),Y=s(e=>e%2===0?"2-digit":"numeric","numeric");function At(e,t){switch(e.char){case"y":return{year:Y(e.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return t(`${e.desc} is not supported; falling back to year:numeric`,N.WARNING),{year:"numeric"}}}s(At,"yearOptions");function bt(e,t){switch(e.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:t(`${e.desc} is not supported with width ${e.width}`);return}}s(bt,"monthStyle");function St(e,t){let{char:r,desc:a,width:n}=e;if(r==="d")return Y(n);t(`${a} is not supported`)}s(St,"dayStyle");function Nt(e,t){let{char:r,desc:a,width:n}=e;if((r==="c"||r==="e")&&n<3){let l=`Numeric value is not supported for ${a}; falling back to weekday:short`;t(l,N.WARNING)}return Ge(n)}s(Nt,"weekdayStyle");function Rt(e){let t=Y(e.width),r;switch(e.char){case"h":r="h12";break;case"H":r="h23";break;case"k":r="h24";break;case"K":r="h11";break}return r?{hour:t,hourCycle:r}:{hour:t}}s(Rt,"hourOptions");function vt(e,t){let{char:r,desc:a,width:n}=e;switch(r){case"v":case"z":return n===4?"long":"short";case"V":if(n===4)return"long";t(`${a} is not supported with width ${n}`);return;case"X":t(`${a} is not supported`);return}return"short"}s(vt,"timeZoneNameStyle");function Dt(e,t){switch(e.field){case"era":return{era:Ge(e.width)};case"year":return At(e,t);case"month":return{month:bt(e,t)};case"day":return{day:St(e,t)};case"weekday":return{weekday:Nt(e,t)};case"period":return;case"hour":return Rt(e);case"min":return{minute:Y(e.width)};case"sec":return{second:Y(e.width)};case"tz":return{timeZoneName:vt(e,t)};case"quarter":case"week":case"sec-frac":case"ms":t(`${e.desc} is not supported`)}}s(Dt,"compileOptions");function ge(e,t,r=a=>{throw a}){let a={timeZone:t},n=[];for(let l of e){let{error:u,field:g,str:w}=l;if(u){let I=new N(u.message,l);I.stack=u.stack,r(I)}if(w){let I=`Ignoring string part: ${w}`;r(new N(I,l,N.WARNING))}g&&(n.indexOf(g)===-1?n.push(g):r(new N(`Duplicate ${g} token`,l)));let E=Dt(l,(I,R)=>r(new N(I,l,R)));E&&Object.assign(a,E)}return a}s(ge,"getDateFormatOptions");var Ct={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},qe=s(e=>e>="A"&&e<="Z"||e>="a"&&e<="z","isLetter");function Ut(e,t){let r=e[t],a=1;for(;e[++t]===r;)++a;let n=Ct[r];if(!n){let l=`The letter ${r} is not a valid field identifier`;return{char:r,error:new Error(l),width:a}}return{char:r,field:n.field,desc:n.desc,width:a}}s(Ut,"readFieldToken");function Lt(e,t){let r=e[++t],a=2;if(r==="'")return{char:"'",str:r,width:a};for(;;){let n=e[++t];if(++a,n===void 0){let l=`Unterminated quoted literal in pattern: ${r||e}`;return{char:"'",error:new Error(l),str:r,width:a}}else if(n==="'"){if(e[++t]!=="'")return{char:"'",str:r,width:a};++a}r+=n}}s(Lt,"readQuotedToken");function xt(e,t){let r=e[t];if(!r)return null;if(qe(r))return Ut(e,t);if(r==="'")return Lt(e,t);let a=r,n=1;for(;;){let l=e[++t];if(!l||qe(l)||l==="'")return{char:r,str:a,width:n};a+=l,n+=1}}s(xt,"readToken");function te(e){let t=[],r=0;for(;;){let a=xt(e,r);if(!a)return t;t.push(a),r+=a.width}}s(te,"parseDateTokens");function Ve(e,t){return e.filter(r=>r.type!=="content").length?e.map(r=>{if(r.type==="content")return t(r.value);if(r.type==="octothorpe")return"#";if(r.type==="argument")return[r.arg];if(r.type==="function"){let l=r?.param?.[0];if(r.key==="date"&&l){let u=kt(l.value.trim(),g=>{throw new Error(`Unable to compile date expression: ${g.message}`)});return[r.arg,r.key,u]}return l?[r.arg,r.key,l.value.trim()]:[r.arg,r.key]}let a=r.pluralOffset,n={};return r.cases.forEach(({key:l,tokens:u})=>{let g=l[0]==="="?l.slice(1):l;n[g]=Ve(u,t)}),[r.arg,r.type,{offset:a,...n}]}):e.map(r=>t(r.value))}s(Ve,"processTokens");function kt(e,t){if(/^::/.test(e)){let r=te(e.substring(2));return ge(r,void 0,t)}return e}s(kt,"compileDateExpression");function Pt(e,t=r=>r){return Ve((0,je.parse)(e),t)}s(Pt,"compileMessageOrThrow");function We(e,t=r=>r){try{return Pt(e,t)}catch(r){return console.error(`${r.message}
24
-
25
- Message: ${e}`),[e]}}s(We,"compileMessage");var C=s(e=>typeof e=="string","isString"),_e=s(e=>typeof e=="function","isFunction"),Ke=new Map,Qe="en";function we(e){return[...Array.isArray(e)?e:[e],Qe]}s(we,"normalizeLocales");function Oe(e,t,r){let a=we(e);r||(r="default");let n;if(typeof r=="string")switch(n={day:"numeric",month:"short",year:"numeric"},r){case"full":n.weekday="long";case"long":n.month="long";break;case"short":n.month="numeric";break}else n=r;return re(()=>ae("date",a,r),()=>new Intl.DateTimeFormat(a,n)).format(C(t)?new Date(t):t)}s(Oe,"date");function Mt(e,t,r){let a;if(r||(r="default"),typeof r=="string")switch(a={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":a.timeZoneName="short";break;case"short":delete a.second}else a=r;return Oe(e,t,a)}s(Mt,"time");function Ee(e,t,r){let a=we(e);return re(()=>ae("number",a,r),()=>new Intl.NumberFormat(a,r)).format(t)}s(Ee,"number");function $e(e,t,r,{offset:a=0,...n}){let l=we(e),u=t?re(()=>ae("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):re(()=>ae("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return n[r]??n[u.select(r-a)]??n.other}s($e,"plural");function re(e,t){let r=e(),a=Ke.get(r);return a||(a=t(),Ke.set(r,a)),a}s(re,"getMemoized");function ae(e,t,r){let a=t.join("-");return`${e}-${a}-${JSON.stringify(r)}`}s(ae,"cacheKey");var ze=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Xe=s(e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(t,r,a)=>{if(r){let n=parseInt(r,16);return String.fromCharCode(n)}else{let n=parseInt(a,16);return String.fromCharCode(n)}}),"decodeEscapeSequences"),Je="%__lingui_octothorpe__%",Ft=s((e,t,r={})=>{let a=t||e,n=s(u=>typeof u=="object"?u:r[u],"style"),l=s((u,g)=>{let w=Object.keys(r).length?n("number"):void 0,E=Ee(a,u,w);return g.replace(new RegExp(Je,"g"),E)},"replaceOctothorpe");return{plural:s((u,g)=>{let{offset:w=0}=g,E=$e(a,!1,u,g);return l(u-w,E)},"plural"),selectordinal:s((u,g)=>{let{offset:w=0}=g,E=$e(a,!0,u,g);return l(u-w,E)},"selectordinal"),select:Ht,number:s((u,g)=>Ee(a,u,n(g)||{style:g}),"number"),date:s((u,g)=>Oe(a,u,n(g)||g),"date"),time:s((u,g)=>Mt(a,u,n(g)||g),"time")}},"getDefaultFormats"),Ye=s((e,t)=>e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,"getOwnProperty"),Ht=s((e,t)=>(Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0)??t.other,"selectFormatter");function Bt(e,t,r){return(a={},n,l)=>{let u=Ft(t,r,n),g=s(I=>{let R=Ye(l,I);return Ye(a,I)??(_e(R)?R():R)},"getValue"),w=s((I,R=!1)=>Array.isArray(I)?I.reduce((P,M)=>{if(M==="#"&&R)return P+Je;if(C(M))return P+M;let[D,b,Q]=M,F={};b==="plural"||b==="selectordinal"||b==="select"?Object.entries(Q).forEach(([B,ie])=>{F[B]=w(ie,b==="plural"||b==="selectordinal")}):F=Q;let H;if(b){let B=u[b];H=B(g(D),F)}else H=g(D);return H==null?P:P+H},""):I,"formatMessage"),E=w(e);return C(E)&&ze.test(E)?Xe(E):C(E)?E:E?String(E):""}}s(Bt,"interpolate");var ye=class{static{s(this,"EventEmitter")}_events={};on(t,r){return this._events[t]??=new Set,this._events[t].add(r),()=>this.removeListener(t,r)}removeListener(t,r){let a=this._events[t];a?.delete(r),a?.size===0&&delete this._events[t]}emit(t,...r){let a=this._events[t];if(a)for(let n of[...a])n.apply(this,r)}},Te=class extends ye{static{s(this,"I18n")}_locale="";_locales;_messages=Object.create(null);_variables={};_missing;_messageCompiler;constructor(t){super(),t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.variables!=null&&(this._variables={...t.variables}),(typeof t.locale=="string"||t.locales)&&this.activate(t.locale??Qe,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get variables(){return this._variables}setVariable(t,r){return r===void 0?delete this._variables[t]:this._variables[t]=r,this.emit("change"),this}setVariables(t){return this._variables={..._e(t)?t(this._variables):t},this.emit("change"),this}setMessagesCompiler(t){return this._messageCompiler=t,this}_load(t,r){let a=Object.prototype.hasOwnProperty.call(this._messages,t)?this._messages[t]:void 0;a?Object.assign(a,r):this._messages[t]=r}load(t,r){typeof t=="string"&&typeof r=="object"?this._load(t,r):Object.entries(t).forEach(([a,n])=>this._load(a,n)),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:a}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=a,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r,a){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let n=a?.message;t||(t=""),C(t)||(r=t.values||r,n=t.message,t=t.id);let l=this.messages,u=Object.prototype.hasOwnProperty.call(l,t)?l[t]:void 0,g=u===void 0,w=this._missing;if(w&&g)return _e(w)?w(this._locale,t):w;g&&this.emit("missing",{id:t,locale:this._locale});let E=u||n||t;return C(E)&&(this._messageCompiler?E=this._messageCompiler(E):console.warn(`Uncompiled message detected! Message:
26
-
27
- > ${E}
28
-
29
- That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
30
- ICU features such as interpolation and plurals will not work properly for that message.
31
-
32
- Please compile your catalog first.
33
- `)),C(E)&&ze.test(E)?Xe(E):C(E)?E:Bt(E,this._locale,this._locales)(r,a?.formats,this._variables)}t=this._.bind(this);date(t,r){return Oe(this._locales||this._locale,t,r)}number(t,r){return Ee(this._locales||this._locale,t,r)}};function Ie(e={}){return new Te(e)}s(Ie,"setupI18n");var Xr=Ie();var se=Ae(st(),1);var Gt={},Ze="en",qt={en:Gt},V=new Map,jt=1e4,Vt=s(e=>{let t=V.get(e);return t===void 0?(t=We(e),V.size>=jt&&V.delete(V.keys().next().value)):V.delete(e),V.set(e,t),t},"I"),Wt=s((e=Ze,t=qt)=>{let r=Ie();r.setMessagesCompiler(Vt);for(let[a,n]of Object.entries(t))r.load(a,n);return r.activate(t[e]===void 0?Ze:e),r},"M"),Kt=Wt(),$t=(0,se.createContext)(Kt),ra=s(()=>{let e=(0,se.use)($t);return(t,r)=>e._(t,r)},"S");export{le as a,ce as b,dt as c,ht as d,ut as e,ct as f,ur as g,cr as h,dr as i,hr as j,mt as k,fr as l,pr as m,mr as n,xe as o,gt as p,gr as q,_r as r,_t as s,Et as t,Er as u,yr as v,Tr as w,br as x,Wt as y,Kt as z,$t as A,ra as B};
@@ -1 +0,0 @@
1
- import{a as r}from"./chunk-5PEAXTYQ.js";var d=[{headings:["Vocabulary","The mental model","The components","Request lifecycle","The data tiers","Compute tiers","The consistency model","The real-time engine"],id:"architecture",summary:"The full picture \u2014 topology, request lifecycle, the data tiers, the consistency model, and the design decisions behind them.",title:"Architecture"},{headings:["Choose Lunora when","Choose something else when","Against each alternative","Check these before you commit"],id:"choosing-lunora",summary:"A decision guide for choosing Lunora over Convex, Supabase, Firebase, Appwrite, or raw Cloudflare, including the cases where Lunora is the\u2026",title:"Is Lunora the right backend?"},{headings:["How telemetry reaches the cloud","Traces","Issues","Logs","Metrics","Scoped ingest keys","Bring your own OpenTelemetry","Retention and redaction"],id:"cloud/monitoring",summary:"The Lunora cloud is a managed OpenTelemetry backend + control plane \u2014 deploy to it and your traces, logs, metrics, and AI generations flow\u2026",title:"Monitoring"},{headings:["When to use an action vs a mutation","ActionCtx","Calling queries and mutations from an action","Scheduling follow-up work"],id:"concepts/actions",summary:"Non-deterministic functions for external APIs and side effects \u2014 the action builder and its ActionCtx.",title:"Actions"},{headings:["Keep your session authority","Declare ownership once","Call Lunora from your own Worker","Dev proxy: two silent failures","Run both engines during the migration","Test it without a worker","When something is stuck"],id:"concepts/adopt-in-an-existing-app",summary:"Add Lunora to a working product that already has its own auth, Worker, and data layer \u2014 without rewriting either.",title:"Adopt in an existing app"},{headings:["Static lints","Runtime lints","Running advisors"],id:"concepts/advisors",summary:"Splinter-style lints that catch schema, performance, and security problems \u2014 many before you deploy.",title:"Advisors"},{headings:["Agent skills","Agent mode","The docs server","The local server","The MCP server","Keeping generated types honest"],id:"concepts/ai-tooling",summary:"Teach Claude Code, Cursor, and Copilot how to use Lunora \u2014 agent skills, agent-aware dev mode, the docs server, and the MCP server.",title:"AI coding agents"},{headings:["What lands in your project","Wire it up","The cards","Enabling the optional flows","Password rules","Username availability","Being an OAuth provider","Avatar and logo uploads"],id:"concepts/auth-ui",summary:"Copy-in sign-in, settings, and organization screens for React, Vue, Svelte, Solid, and Angular \u2014 the code lands in your project and you\u2026",title:"Auth UI"},{headings:["ctx.auth inside functions","@lunora/auth on the server","Routing /api/auth/*","The client side","Feeding row-level security","See also"],id:"concepts/authentication",summary:"How ctx.auth threads the signed-in user through queries, mutations, and actions \u2014 and feeds row-level security.",title:"Authentication"},{headings:["Point-in-time recovery","Snapshot backups","Export and import","Streaming data out continuously","Practising a restore"],id:"concepts/backups",summary:"Snapshot a deployment, recover a shard to any moment in the last 30 days, and move data in and out as NDJSON.",title:"Backups, export & import"},{headings:["Schema first","Reads","Writes","Inputs and safety","Scaling","Lean on Advisors"],id:"concepts/best-practices",summary:"The opinionated idioms that keep a Lunora app fast, safe, and reactive.",title:"Best practices"},{headings:["Enabling Workers Cache","Declarative cache headers on httpRoute","Programmatic cache purging","Why only HTTP actions?","Memoizing an expensive action result","Scaffolding cache-aware routes","Best practices"],id:"concepts/caching",summary:"Edge caching with Cloudflare Workers Cache \u2014 declarative headers on HTTP routes and programmatic cache purging from actions.",title:"Caching"},{headings:["The short version","Rows or events?","Live topics, whispers and rooms","Streams","Write a row, then tell the page","Things to know before you rely on a live topic"],id:"concepts/choosing-a-data-channel",summary:"Live query, stream, live topic, whisper, room or socket? Which one to use for which job.",title:"Choosing a data channel"},{headings:["Declaring it","What _commitSeq guarantees","Refreshed on every write","Three things it is not","When to reach for it"],id:"concepts/commit-ordering",summary:"Declare .commitOrdered() so every row carries _commitSeq \u2014 a per-shard sequence that orders commits, and the cursor a changefeed can page\u2026",title:"Commit ordering"},{headings:["Defining one","Installing one","What the namespace guarantees","What a component does NOT get","In the architecture view","Migrations","See also"],id:"concepts/components",summary:"Package backend features \u2014 tables, functions, and context \u2014 as an installable unit that cannot collide with the app that installs it.",title:"Components"},{headings:["Constraint kinds","Unique","Non-null","Foreign-key integrity","Error codes"],id:"concepts/constraints",summary:"Unique, non-null and foreign-key integrity declared on the schema and enforced at write time.",title:"Constraints"},{headings:["What it pins","Pinning auth and voice","Pinning mail","Set it once: changing it strands data","Runbook: moving an app to a new jurisdiction"],id:"concepts/data-residency",summary:"Pin Durable Objects to a Cloudflare jurisdiction with .jurisdiction(), and the export\u2192import runbook for moving regions.",title:"Data residency"},{headings:["The type table","Numbers, bigints, and dates","Optional versus null","Values that JSON cannot carry","Size limits","Types outside the schema"],id:"concepts/data-types",summary:"The value types a Lunora document can hold, how each is stored, and which ones need the wire codec to survive JSON.",title:"Data types"},{headings:["Start with lunora doctor","Catch it before it runs","The error overlay","Structured logging with ctx.log","The Studio","Find the slow or failing function","Watch production","Debugging authentication"],id:"concepts/debugging",summary:"The tools to reach for when something is broken \u2014 doctor, the error overlay, ctx.log, the Studio, insights, and live logs.",title:"Debugging"},{headings:["How ids are minted","Typing a reference with v.id","Reading and following ids","Validating an id that came from outside","Ids in exports and imports"],id:"concepts/document-ids",summary:"Every row carries an _id and a _creationTime \u2014 how they are minted, how v.id types a reference, and what an id does and does not guarantee.",title:"Document IDs"},{headings:["Locally: .dev.vars","In production: secrets and vars","Accessing env inside your app","The rule: never commit secrets"],id:"concepts/environment-variables",summary:"Configure secrets and vars \u2014 .dev.vars locally, wrangler secrets in production, env bindings inside functions.",title:"Environment variables"},{headings:["Multiple environments","Linking a checkout to a deployment","Preview deployments","Moving traffic between versions","Build once, deploy many","Custom domains","Trying a deploy without an account","Who changed what"],id:"concepts/environments",summary:"Running staging next to production, deploying an isolated environment, checking pull requests with a dry run, an isolated preview per pull\u2026",title:"Environments & releases"},{headings:["Throwing from a handler","Expected vs. unexpected","Reading error state on the client","Optimistic updates roll back on rejection","See also"],id:"concepts/error-handling",summary:"Throwing inside handlers, how errors travel to the client, and reading error state without losing optimistic safety.",title:"Error handling"},{headings:["What reaches your tracker","Wire it once, to both halves","Sentry","PostHog","Datadog, Axiom, Better Stack, and the rest","Source maps","Privacy"],id:"concepts/error-tracking",summary:"Send Lunora's failed calls and error logs to Sentry, PostHog, Datadog, or any error tracker, with the thrown error's real stack and\u2026",title:"Error tracking"},{headings:["External provider or @lunora/auth","The resolver","Client: hand over the token, refresh it","WebSockets and live queries","RLS with org claims","Memoization and revocation","Composing with @lunora/auth or Cloudflare Access","Walkthrough: Clerk"],id:"concepts/external-auth",summary:"Use Clerk, WorkOS AuthKit, Auth0, Supabase or any OIDC JWT issuer as your identity provider \u2014 verify its token at the Worker and feed\u2026",title:"External auth"},{headings:["Which contexts expose what","Uploading","Serving files","Named buckets","Deleting","See also"],id:"concepts/file-storage",summary:"Typed R2 buckets exposed as ctx.storage \u2014 uploading, serving via signed URLs, and deleting files from your functions.",title:"File storage"},{headings:["Where the work happens","Choosing between them","When a bare filter is fine","How the advisors catch this","Composing","Inside an object column"],id:"concepts/filtering",summary:".filter() is a JavaScript predicate applied after rows are loaded \u2014 when to use it, and when to reach for an index instead.",title:"Filtering"},{headings:["The three context types","Surfaces on every ctx","ctx field matrix","Add-on surfaces (codegen-wired)"],id:"concepts/function-context",summary:"The ctx object passed to every query, mutation, and action \u2014 and what each kind is allowed to do with it.",title:"Function context"},{headings:["api.ts and internal.ts: function references","server.ts: typed helpers","dataModel.ts: Id and Doc","Importing the generated code","lunora/* vs @lunora/* imports","Linting and formatting","Regenerating"],id:"concepts/generated-code",summary:"What @lunora/codegen emits from your schema.ts, and how api / Id / Doc keep server and client in sync.",title:"Generated code"},{headings:["Declaring a point column and a geo index",'"Places near me": near(point, radiusMeters)',"Bounding box: within(box)","Single-shard scope","How the Advisors catch geo mistakes"],id:"concepts/geospatial",summary:'Store lat/lng points with v.geoPoint, index them with .geoIndex, and answer "places near me" and bounding-box reads with withGeoIndex.',title:"Geospatial"},{headings:["httpAction","HttpActionCtx","Typed routes with httpRoute","How routes mount in the worker"],id:"concepts/http-endpoints",summary:"Public HTTP routes with httpAction and the Hono-based httpRouter.",title:"HTTP endpoints"},{headings:["Declaring an index","Querying with withIndex","Why every filtered read should hit an index","How the Advisors catch unindexed reads","Checking a read with explain","Aggregate indexes"],id:"concepts/indexes",summary:"Declare B-tree indexes on tables and query them with withIndex \u2014 every filtered read should hit one.",title:"Indexes"},{headings:["Calling internal functions","Internal functions and scheduling"],id:"concepts/internal-functions",summary:"internalQuery / internalMutation / internalAction \u2014 server-only functions never exposed to the client.",title:"Internal functions"},{headings:["Declare the stream","Publish","Follow a topic in the browser","Authorization","Where delivery stops","Platform support","React Native"],id:"concepts/live-streams",summary:"Publish events to named topics from the server and follow many of them over one SSE connection.",title:"Live topic streams"},{headings:["Turn CDC on first","Why the DO topology fits","Shapes \u2014 partial replication","The poke diff protocol","Custom mutators \u2014 optimistic, server-authoritative","The client store","Cross-shard joins \u2014 the one limit"],id:"concepts/local-first",summary:"Shapes, the poke diff protocol, and custom mutators \u2014 the Zero-class sync engine.",title:"Local-first sync"},{headings:["Strategies","Roles and bypass","What's masked, what isn't","Sensitive arguments","Tooling","See also"],id:"concepts/masking",summary:"Column-level redaction on the read path \u2014 the companion to row-level security.",title:"Data masking"},{headings:["The lifetime","Rebuilding: onShardInit","What .memory() buys, and what it does not","Restrictions","Choosing between .memory() and .ttl()"],id:"concepts/memory-tables",summary:"Declare .memory() for state the shard rebuilds rather than remembers \u2014 presence, cursors, live counters \u2014 and onShardInit to bring it back\u2026",title:"Memory tables"},{headings:["Attaching middleware","Augmenting ctx","Composing concerns"],id:"concepts/middleware",summary:"Compose cross-cutting concerns \u2014 auth checks, rate limiting, logging \u2014 and augment ctx for downstream handlers.",title:"Middleware"},{headings:["The deploy gate tells you when you need one","Schema migrations (global tables)","Data migrations (sharded tables)","Inspecting run-state in the Studio","One-off data edits without a deploy","Resetting local state"],id:"concepts/migrations",summary:"Schema-change SQL for global tables and online, resumable data migrations.",title:"Migrations"},{headings:["Queues and topics","What you get","Table ownership","Installed components"],id:"concepts/modules",summary:"Group lunora/ folders into modules and get a module catalog and an architecture diagram from codegen.",title:"Modules"},{headings:["Running as one node in a dev graph","Deploying from external IaC","Consuming the generated API from a sibling package","Calling the backend from a sibling Worker"],id:"concepts/monorepos-and-iac",summary:"Running the Lunora worker as one node in a larger dev graph, deploying it from Terraform/Pulumi/Alchemy, and consuming its generated API\u2026",title:"Monorepos and external IaC"},{headings:["The output is pinned to your CLI version","Wiring it into your project","What you get, and what you don't","Conformance"],id:"concepts/non-js-sdks",summary:"Generate a typed, self-contained Lunora client for Python, Go, Ruby, Rust, Swift, Java, Kotlin or Dart/Flutter \u2014 vendored into your\u2026",title:"Non-JS SDKs"},{headings:["Configure defineNotify","VAPID / FCM config via .dev.vars","Native devices (Android and iOS)","Register a browser push subscription","Send from an action","Queue-backed fan-out"],id:"concepts/notifications",summary:"Configure defineNotify in lunora/notify.ts for Web Push + FCM, register browser subscriptions, and send via ctx.notify / ctx.push from an\u2026",title:"Push notifications"},{headings:["Sinks","Structured logging with ctx.log","Tracing sub-operations with ctx.trace","Database telemetry (ctx.db and ctx.sql)","Trace sampling","Source maps","Application metrics with ctx.metrics","Container telemetry"],id:"concepts/observability",summary:"Ship Lunora's logs, traces, and metrics to any OTLP collector \u2014 the otlpSink worker option, ctx.log/ctx.trace/ctx.metrics, the zero-config\u2026",title:"Observability"},{headings:["Mutations are serialized, not retried","Where conflicts still happen","Handling a conflict on the client","Diagnosing a persistent conflict","Atomicity across shards",".global() tables"],id:"concepts/occ",summary:"Why mutations in one shard are serialized rather than retried, where optimistic-concurrency conflicts still arise, and what atomicity\u2026",title:"OCC & atomicity"},{headings:["Passing the adapters explicitly","What gets persisted","Surviving a breaking deploy","Multiple tabs","Sync status","Connection status UI","Boot with no network (the app shell)","The reconciliation model"],id:"concepts/offline-first",summary:"Persist reads and writes to disk so the app boots, renders, and accepts edits with no network.",title:"Offline-first"},{headings:["PaginationOptions","PaginationResult","Paging through a query","Ordering rows that hold NULL","Paging a findMany","Load more / infinite lists on the client",'Total count ("42 of 1,203")'],id:"concepts/pagination",summary:"Keyset pagination with .paginate(options) \u2014 page through a query and build an infinite list on the client.",title:"Pagination"},{headings:["ctx.db","ctx.auth","ctx.scheduler"],id:"concepts/queries-mutations",summary:"query / mutation / action \u2014 what each is for and how ctx is shaped.",title:"Queries & mutations"},{headings:["How this differs from a trigger","The convergence contract","What the handler receives","Execution and identity","Reads that should not wake you","Watching them work"],id:"concepts/reactors",summary:"Declare onQueryChange to run server logic when a query's result changes \u2014 the actor pattern, with no client on the other end and nothing\u2026",title:"Reactors (server-side reactivity)"},{headings:["Where a shard is created","Replica reads","Sockets near the client"],id:"concepts/read-replicas",summary:"Serve one-shot queries from a copy of the shard in the caller's region, pin where a shard is created, and terminate sockets near the client.",title:"Read replicas & placement"},{headings:["Hibernation","How an update reaches a subscriber","When a re-run fails","Reconnect","When WebSockets are blocked","Durable streams","Whispers (ephemeral peer messages)","Why no MQTT / Pub/Sub"],id:"concepts/realtime",summary:"How subscriptions, deltas, and hibernation fit together.",title:"Real-time"},{headings:["Using items","The manifest","Validation","Building the catalog","Distributing"],id:"concepts/registry-items",summary:"Package a reusable capability \u2014 schema, functions, bindings and env vars \u2014 as a registry item others install with one command.",title:"Authoring registry items"},{headings:["A worked example","The edge set","Directions","Depth, limit and score","Cycles and paging","It is an ordinary read","Fusing the graph into retrieval","From an AI agent"],id:"concepts/relation-graph",summary:"Traverse the foreign-key graph your schema already declares with ctx.db.related \u2014 depth-bounded, cycle-safe, scored by proximity, and\u2026",title:"Relation graph"},{headings:["The descriptors","Many-to-many","Index your foreign keys","Querying across a relation","Writing through a relation","Relations vs the relation graph"],id:"concepts/relations",summary:"Modeling many-to-one, one-to-many and many-to-many relationships with the one / many relation descriptors, foreign-key columns, join\u2026",title:"Relations"},{headings:["Default-closed","URLs and methods","Arguments","Choosing a shard","Authentication","Rate limiting","Caching","OpenAPI"],id:"concepts/rest-api",summary:"Publish a query, mutation, or action as a plain REST endpoint with .expose({ rest: true }) \u2014 default-closed, routed through the procedure\u2026",title:"Public REST API"},{headings:["Policies","Permissions and roles","Relation predicates","What's covered, what isn't","Testing policies","See also"],id:"concepts/rls",summary:"Server-side authorization that decides which rows a procedure can read or write.",title:"Row-level security"},{headings:["Node compatibility","Where the constraints bite","Bundling","The worker entry","Build once, deploy many"],id:"concepts/runtime",summary:"Everything runs on the Workers runtime \u2014 what that means for Node APIs, dependencies, and the 64 MiB bundle you have to fit into.",title:"Runtime & bundling"},{headings:["Deferring a function","Recurring jobs (Cron Triggers)","How dispatch works","See also"],id:"concepts/scheduling",summary:"Defer follow-up work with ctx.scheduler.runAfter / runAt, and run recurring jobs via Cron Triggers.",title:"Scheduling"},{headings:["Validators","Tier modifiers","Indexes"],id:"concepts/schema",summary:"Declarative tables, validators, indexes and sharding.",title:"Schema"},{headings:["Declaring a search index","Language","Running a search query","Matching rules","Filter fields","Relevance ordering, .take(n) and pagination","Limits","Backfill and staged"],id:"concepts/search",summary:"Declare a search index on a table and run relevance-ordered full-text queries.",title:"Full-text search"},{headings:["The HTTP edge","Auth, cookies, and secrets","Protecting public procedures","Securing sharded access","Advisor catalog","Config-time validation"],id:"concepts/security",summary:"Lunora's secure-by-default posture \u2014 the protections you get for free, how to opt out, and the advisor lints that catch the gaps.",title:"Security"},{headings:["From an SSR loader","From a script","From the terminal","From Python","From any language, over HTTP","Writing a new SDK"],id:"concepts/server-clients",summary:"Calling a Lunora deployment without a live subscription \u2014 from SSR loaders, scripts, other languages, or plain HTTP.",title:"Server-side & non-reactive clients"},{headings:["Declare a service","Call it from an action","What Lunora wires","Test an action that calls one","Make the service private","Smart Placement","Platforms","Migrating from URLs and HMAC"],id:"concepts/services",summary:"Call sibling Cloudflare Workers from actions over typed service bindings, run them in one dev session, and deploy them before the app.",title:"Services"},{headings:["When to shard","Migrating a populated table","What stays in the root DO","Going global","Cross-shard reads","The shard registry","Securing shard access"],id:"concepts/sharding",summary:"Default __root__ DO, opt-in .shardBy(), and .global() escape hatch.",title:"Sharding"},{headings:["The one caveat that matters","The read surface","_scheduled_functions","_storage"],id:"concepts/system-tables",summary:"Read pending scheduled jobs and stored file metadata through ctx.db.system \u2014 a read-only, eventually consistent view outside the mutation\u2026",title:"System tables"},{headings:["Install","Configure","Write a test","Run in CI"],id:"concepts/testing-ai-features",summary:"Drive a Lunora app's AI flows in a real browser with the e2e runner, and judge non-deterministic model output with natural-language\u2026",title:"Testing AI features end to end"},{headings:["The in-memory harness","Asserting reactive results","Mail-catcher helpers (E2E)","Running in CI"],id:"concepts/testing",summary:"Unit-test queries, mutations, and actions in memory with lunoraTest \u2014 no worker, no network.",title:"Testing"},{headings:["Declaring a TTL","Sweep semantics: coarse, batched, bounded","Not on .global() tables","Interaction with soft delete","How the Advisors catch TTL mistakes"],id:"concepts/ttl",summary:"Declare a table-level .ttl() so a DO alarm sweep auto-deletes expired rows \u2014 sessions, OTPs, and other ephemeral data.",title:"TTL & auto-expiry"},{headings:["Where types come from","Do not restate what is inferred","Reach for Doc and Id","Pin the client contract with .output()","Optional versus null in types","Bringing your own validators","Project configuration","Keeping types honest in CI"],id:"concepts/typescript",summary:"Getting the most out of Lunora's end-to-end types \u2014 where types come from, what to annotate, and what to let inference do.",title:"TypeScript"},{headings:["Job 1: column types in defineTable","Job 2: argument and return validation","Return-type inference to the client","Common validators","Coming from zod","ValidationError"],id:"concepts/validation",summary:"The v.* validators that type your columns and parse query / mutation / action inputs and outputs end to end.",title:"Validation"},{headings:["Declaring an index","Automatic write sync","ctx.vectors","RAG with @lunora/ai","Binding & config wiring"],id:"concepts/vector-search",summary:"Typed Vectorize indexes on ctx.vectors \u2014 automatic write sync, similarity search, and RAG with embeddings.",title:"Vector search"},{headings:["The specification","Conformance fixtures","SDKs built on it"],id:"concepts/wire-protocol",summary:"The language-independent Lunora client\u2194server wire protocol and the golden fixtures every SDK is tested against.",title:"Wire protocol"},{headings:["Idle and small apps: the free plan","Past the free plan: Workers Paid","Which meters grow with your app","Choosing where the cost lands"],id:"cost",summary:"What a self-hosted Lunora app costs on Cloudflare, what the free plan covers, and which meters grow with traffic.",title:"What Lunora costs to run"},{headings:["wrangler.jsonc","lunora.config.ts","Secrets","Containers","Deploy","Durable Object class limit","Worker size","Streaming logs"],id:"deployment",summary:"Wrangler bindings, secrets, and the deploy flow.",title:"Deployment"},{headings:["Redacted codes","Build-time errors","Throwing your own","Error codes"],id:"errors",summary:"Every well-known Lunora error code \u2014 its HTTP status, what it means, and what to do about it.",title:"Errors & warnings reference"},{headings:["Branching on one","The same number, in the document","Where the numbers come from","From your own code"],id:"exit-codes",summary:"The exit code every lunora command terminates with \u2014 what each number means, and how it is derived from the error catalog.",title:"CLI exit codes"},{headings:["Is Lunora open source?","Can I run Lunora on my own Cloudflare account?","Is Lunora production-ready?","Does Lunora run on Cloudflare's free plan?","Can one app scale past a single Durable Object?","How do I move an existing app to Lunora?"],id:"faq",summary:"Short answers to the questions people ask before adopting Lunora, with links to the pages that go deeper.",title:"FAQ"},{headings:["Install","Provide the client","Live queries","Mutations","Connection status","Reactive loaders"],id:"frameworks/angular",summary:"Use Lunora with Angular \u2014 provideLunora in your app config, signal-based liveQuery, imperative mutate, and a connectionStatus signal.",title:"Angular"},{headings:["Install","Exports","The integration","Single-worker composition with withLunora","Reactive-loader server helpers","Deploy"],id:"frameworks/astro",summary:"Compose Astro's @astrojs/cloudflare worker with Lunora realtime, plus reactive-loader server helpers for .astro frontmatter.",title:"Astro"},{headings:["One worker, two dispatch flows","Mount Lunora inside your framework","The per-framework matrix","Client adapters","Scaffolding","Vite composition"],id:"frameworks/bring-your-framework",summary:"Compose any meta-framework's SSR with Lunora realtime in one Cloudflare Worker.",title:"Bring your framework"},{headings:["One worker, two dispatch flows","Class A: Lunora owns the worker entry","Class B: the framework owns the CF adapter","Class C: SPA / SSR-less","Wrangler reconciliation"],id:"frameworks/deploy",summary:"One worker, one deploy \u2014 how a composed Lunora + meta-framework app ships to Cloudflare.",title:"Deploy your framework"},{headings:["Why two workers","Wiring them together","Client and server entry points","Loading data in a Server Component","Providing the client","Developing","Deploying"],id:"frameworks/nextjs",summary:"Run Lunora alongside Next.js on Cloudflare with the two-worker split \u2014 RSC loaders that hydrate into live subscriptions.",title:"Next.js"},{headings:["Install","Setup","How it works","Provide the client","Reactive loaders","Feature flags","Verify before deploy","Alternative: two-worker split"],id:"frameworks/nuxt",summary:"Run Lunora and Nuxt as one Cloudflare Worker \u2014 the @lunora/nuxt module mounts /_lunora/** into Nitro, plus reactive-loader server helpers.",title:"Nuxt"},{headings:["Scaffold a new app","Install","Create the client","Provide it","Live queries and mutations","HTTP streams","Local-first (shapes, custom mutators, TanStack DB)","Authentication (better-auth + Expo)"],id:"frameworks/react-native",summary:"Use Lunora in a React Native / Expo app \u2014 the same live hooks, plus an AsyncStorage-backed client and a better-auth Expo bridge.",title:"React Native / Expo"},{headings:["Install","Provide the client","Live queries","Mutations","Auth","Reactive loaders","One worker, one deploy"],id:"frameworks/react",summary:"Use Lunora with React \u2014 a provider, live useQuery/useMutation hooks, and the SSR-seed \u2192 live reactive-loader handoff.",title:"React"},{headings:["The problem with static loaders","The handoff","Why there's no flash","Identity continuity (SSR \u2192 client)","Sharding carries through","Status"],id:"frameworks/reactive-loaders",summary:"Your loaders are live \u2014 SSR data that hydrates into a real-time subscription with no flash.",title:"Reactive loaders"},{headings:["Install","Solid 1.x and Solid 2.0","Provide the client","Live queries","Mutations","Reactive loaders"],id:"frameworks/solid",summary:"Use Lunora with SolidJS \u2014 a provider, live createQuery/createMutation primitives, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Solid"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","One worker, one deploy"],id:"frameworks/svelte",summary:"Use Lunora with Svelte 5 / SvelteKit \u2014 context-provided client, live query/mutation stores, and the SSR-seed \u2192 live reactive-loader handoff.",title:"Svelte"},{headings:["What you're proving","1. Scaffold","2. Dev","3. Prove SSR preload (curl the raw HTML)","4. Prove the live subscription attaches","5. Prove live update (two tabs)","Identity check (optional, with auth)",'What "pass" looks like'],id:"frameworks/verify-live-loaders",summary:"How to actually prove live loaders work \u2014 scaffold, SSR-curl the preloaded value, two-tab live update.",title:"Manual end-to-end verification"},{headings:["Install","Provide the client","Live queries","Mutations","Reactive loaders","Worker composition"],id:"frameworks/vue",summary:"Use Lunora with Vue 3 \u2014 a client plugin, live useQuery/useMutation composables, and the server-side rendering (SSR) seed to live\u2026",title:"Vue"},{headings:["Requirements"],id:"getting-started",summary:"Scaffold a Lunora app and run the dev loop in under a minute.",title:"Getting started"},{headings:["Durable Objects","Statement limits (Durable Objects **and** D1)","Transaction limits","D1","R2","Workers","Worker startup (error 10021)","Queues"],id:"limits",summary:"Cloudflare ceilings you should keep in your head.",title:"Limits"},{headings:["Two translations, not one","Schema: transposing the relation graph","Procedures: the shape deltas","Writes: .returning() does not survive","Components decompose by hand"],id:"migrating/from-a-convex-toolkit",summary:"The second translation step a Drizzle-style schema DSL and a tRPC-style procedure builder add on top of the raw Convex mapping.",title:"Migrating from a Convex toolkit"},{headings:["Bump strategy","Breaking changes already landed","Recommended (non-breaking) follow-ups","See also"],id:"migrating/from-alpha",summary:"How a 1.0.0-alpha.* app moves to stable \u2014 dependency bumps plus every breaking change already landed on the road to 1.0.",title:"Upgrading from alpha to 1.0"},{headings:["At a glance","Schema","Queries, mutations, actions","React","Auth","Scheduler","File storage","Subscriptions"],id:"migrating/from-convex",summary:"Side-by-side mapping \u2014 schema, queries, mutations, actions, React hooks.",title:"Migrating from Convex"},{headings:["At a glance","Schema","Reads: onSnapshot \u2192 useQuery","Writes: setDoc \u2192 mutation","Cloud Functions \u2192 actions","Auth","File storage","Scheduled work"],id:"migrating/from-firebase",summary:"Side-by-side mapping \u2014 Firestore, Cloud Functions, Auth, Storage, and real-time listeners.",title:"Migrating from Firebase"},{headings:["At a glance","Schema","Reads: supabase.from(...).select() \u2192 useQuery","Writes: .insert() \u2192 mutation","Row-level security","Edge Functions \u2192 actions","Auth","File storage"],id:"migrating/from-supabase",summary:"Side-by-side mapping \u2014 Postgres tables, RLS, Edge Functions, Auth, Storage, and Realtime.",title:"Migrating from Supabase"},{headings:["No arbitrary external SQL or ad-hoc cross-dataset joins","RPC-first, not REST-first","Cross-shard writes are eventual, not atomic","No data warehouse hosting in the framework","No managed control plane as a hard dependency","Also deliberately absent","See also"],id:"non-goals",summary:"The things Lunora deliberately does not do \u2014 each with the reason it's a boundary and the escape hatch when you need past it.",title:"Design boundaries"},{headings:["Why Lunora","Self-host, or use Lunora Cloud","How Lunora compares","Where it's rough","What ships in the alpha","Start building"],id:"overview",summary:"The Convex-style real-time backend that runs on your own Cloudflare account \u2014 typed end to end, live by default, ~$0 at idle.",title:"Overview"},{headings:["Bindings and wrangler config","Secrets","LUNORA_ADMIN_TOKEN and the admin plane","Rate limiting and abuse","Auth and row-level security","Migrations","Observability","Health and readiness endpoint"],id:"production-checklist",summary:"Everything to verify before a Lunora app takes real traffic \u2014 bindings, secrets, admin tokens, rate limits, RLS, migrations, observability.",title:"Production checklist"},{headings:["Pick a starting point","Adding Lunora to an app you already have","What you get either way","Next steps"],id:"quickstarts",summary:"Every starting point Lunora scaffolds \u2014 pick your framework, run one command, and get a live backend wired to it.",title:"Quickstarts"},{headings:["1. See where you stand","2. Create the usage alerts","3. Add the budget alert by hand","4. Check delivery","In CI"],id:"runaway-bill",summary:"Set Cloudflare usage alerts well above normal with `lunora cloudflare alerts`, add the budget alert the API cannot, and check what\u2026",title:"Protect yourself from a runaway bill"},{headings:["Why startup grows with the app","Measure it locally","The fix: load function modules on demand","Keep heavy packages off the startup path"],id:"startup-cpu-limit",summary:'Why a large app fails to deploy with "Script startup exceeded CPU time limit", how to measure it, and how lazy function loading and\u2026',title:"Worker startup CPU limit (error 10021)"},{headings:["1. Scaffold","2. Model the data","3. Generate the migration","4. Write the query","5. Write the mutation","6. Wire the React app","7. Run the dev loop","8. Deploy"],id:"tutorial/realtime-chat",summary:"End-to-end Lunora walkthrough \u2014 schema, query, mutation, subscription, React, sharding.",title:"Build a real-time chat app in 15 minutes"},{headings:["Know when to act","Step 1: shard the messages","Step 2: put identities in a global table","Step 3: keep fan-out off the hot path","Step 4: lock down shard access","Step 5: migrate the data you already have","Checking your work","What you learned"],id:"tutorial/scaling",summary:"Take the chat app from one Durable Object to many \u2014 shard by channel, put identities in a global table, and keep cross-shard reads off the\u2026",title:"Tutorial: scaling the chat app"},{headings:["Release channels","What SemVer means here","Stability tiers",'What "experimental" means',"See also"],id:"versioning",summary:"What SemVer means for Lunora packages \u2014 release channels, stability tiers, and the experimental surface.",title:"Versioning & stability"}],l="https://lunora.sh/docs/",u=4,m=3,g=200,p=4,y=3,f=2,w=1,v=r(t=>t.slice(0,g).toLowerCase().split(/[^a-z0-9.]+/u).filter(a=>a.length>=m),"w"),b=r((t,a)=>{let i=t.id.toLowerCase(),e=t.title.toLowerCase(),s=t.summary.toLowerCase(),c=t.headings.map(n=>n.toLowerCase()),o=0;for(let n of a)i.includes(n)&&(o+=p),e.includes(n)&&(o+=y),c.some(h=>h.includes(n))&&(o+=f),s.includes(n)&&(o+=w);return o},"v"),k=r(t=>{let a=v(typeof t=="string"?t:""),i=a.length===0?[]:d.map(e=>({candidate:e,rank:b(e,a)})).filter(e=>e.rank>0).sort((e,s)=>s.rank-e.rank).slice(0,u).map(e=>({...e.candidate,url:`${l}${e.candidate.id}`}));return{entries:i.length===0?d.map(e=>e.id):i}},"b"),S=r(t=>{let{entries:a}=k(t);return a.every(i=>typeof i=="string")?[`Documentation pages under ${l}: ${a.join(", ")}`]:a.map(i=>{let e=i;return`${e.title} (${e.url}): ${e.summary} Sections: ${e.headings.join(", ")}`})},"k");export{S as knowledgeExcerpts};