palbase 0.19.2 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{OSREI5EV.js → 2NYI4FOR.js} +2 -2
- package/dist/chunks/{B64PN4SN.js → 45465257.js} +2 -2
- package/dist/chunks/{GYAC4XGQ.js → 4UGIL34D.js} +2 -2
- package/dist/chunks/{EOMNR25V.js → 5QSFOMN7.js} +2 -2
- package/dist/chunks/{HNFLACEJ.js → 6TW5HR5D.js} +1 -1
- package/dist/chunks/{CGPI3ZD2.js → 7BSKXUEV.js} +2 -2
- package/dist/chunks/{EEZBV4BZ.js → BSJV6PEL.js} +1 -1
- package/dist/chunks/{63ALEOYV.js → CFJYJRJ7.js} +2 -2
- package/dist/chunks/{2D6UTNAS.js → CGTOJ44L.js} +1 -1
- package/dist/chunks/{65XX646N.js → DUO4FFKV.js} +2 -2
- package/dist/chunks/{5IKIPSPK.js → ILHFQK3J.js} +1 -1
- package/dist/chunks/KGAMXI25.js +2 -0
- package/dist/chunks/{34FI7FDO.js → KSRRQWGG.js} +2 -2
- package/dist/chunks/{PLAWOADG.js → LN7FO4IE.js} +2 -2
- package/dist/chunks/{SPRDYHDI.js → MPCXNC4L.js} +1 -1
- package/dist/chunks/{3DPITTIG.js → O65ATC5C.js} +2 -2
- package/dist/chunks/{KLXOLRFH.js → Q6OD5IUC.js} +1 -1
- package/dist/chunks/{LH6MM4NX.js → U3U53UJF.js} +1 -1
- package/dist/chunks/{ANPIBUP7.js → UE4A6DEG.js} +2 -2
- package/dist/chunks/{OMXEFKCT.js → W4JKOGHG.js} +3 -3
- package/dist/chunks/{AFNLDC5V.js → WXDISYY6.js} +2 -2
- package/dist/chunks/{M23DJASA.js → X6Y7MMBI.js} +2 -2
- package/dist/chunks/{MLQQWG2B.js → ZYBPLNPD.js} +2 -2
- package/dist/cli.js +3 -3
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/cloud.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/internal/src/messaging/index.d.ts +1 -0
- package/types/internal/src/messaging/search.d.ts +19 -0
- package/types/internal/src/modules/machines.d.ts +28 -2
- package/types/internal/src/modules/messaging.d.ts +69 -2
- package/types/web/src/index.d.ts +1 -1
- package/types/web/src/messaging.d.ts +119 -9
- package/dist/chunks/AJUTYIGD.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! palbase 0.
|
|
1
|
+
/*! palbase 0.20.0 — Palbase SDK License (see LICENSE) */
|
|
2
2
|
var u="X-PoW-Challenge-ID",c="X-PoW-Nonce";function m(e){if(typeof e!="object"||e===null)return null;let t=e;if(t.error!=="pow_required"||typeof t.challenge!="object"||t.challenge===null)return null;let{id:n,prefix:r,difficulty:o}=t.challenge;return typeof n!="string"||typeof r!="string"||typeof o!="number"||!Number.isInteger(o)||o<0?null:{id:n,prefix:r,difficulty:o}}function d(e){return 8*2**e}var s;async function l(){if(s)return s;let e=globalThis;if(e.process?.versions?.node!==void 0||e.process?.versions?.bun!==void 0)try{let r=(await import("node:crypto")).createHash;if(typeof r=="function")return s=o=>new Uint8Array(r("sha256").update(o).digest()),s}catch{}let t=new TextEncoder;return s=async n=>new Uint8Array(await crypto.subtle.digest("SHA-256",t.encode(n))),s}function p(e){let t=0;for(let n of e){if(n===0){t+=8;continue}return t+Math.clz32(n)-24}return t}var w=4096,g=typeof globalThis.setImmediate=="function"?()=>new Promise(e=>globalThis.setImmediate(e)):()=>new Promise(e=>setTimeout(e,0));async function y(e,t={}){if(e.difficulty>24)throw new Error(`proof-of-work: difficulty ${e.difficulty} is above auth's ceiling of 24`);let n=await l(),r=d(e.difficulty),o=Date.now()+(t.timeLimitMs??12e4);for(let i=0;i<r;i++){if(i%w===0&&i>0){if(await g(),t.signal?.aborted)throw t.signal.reason??new DOMException("proof-of-work aborted","AbortError");if(Date.now()>o)throw new Error(`proof-of-work: gave up on difficulty ${e.difficulty} after ${i} attempts`)}let f=n(e.prefix+i),a=f instanceof Uint8Array?f:await f;if(p(a)>=e.difficulty)return{[u]:e.id,[c]:String(i)}}throw new Error(`proof-of-work: no nonce for difficulty ${e.difficulty} within ${r} attempts`)}export{m as a,y as b};
|