@tinkerlandai/longplay-sdk 0.10.31 → 0.10.32
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/CHANGELOG.md +6 -0
- package/dist/{ai-usage-E4c9NSJK.d.ts → ai-usage-T62xehqa.d.ts} +1 -1
- package/dist/{api-BpeJkr6U.d.ts → api-Do-6AyWa.d.ts} +24 -0
- package/dist/{chunk-2TPPGW7V.js → chunk-4XC34JBS.js} +1 -1
- package/dist/{chunk-BQLT2LDP.js → chunk-5HJYR6Z4.js} +1 -1
- package/dist/chunk-5UFRIIGC.js +1 -0
- package/dist/{chunk-TF2OFTYS.js → chunk-6KBCR7JJ.js} +1 -1
- package/dist/{chunk-JNSU2AP2.js → chunk-7MNJH5GB.js} +1 -1
- package/dist/{chunk-6BTJNSQQ.js → chunk-7QL4GF4C.js} +1 -1
- package/dist/{chunk-ACFQLHJR.js → chunk-BXPXJARS.js} +1 -1
- package/dist/{chunk-FVGUBIVT.js → chunk-CZ2RY6RG.js} +1 -1
- package/dist/{chunk-B3KFE57L.js → chunk-EHDHWYVJ.js} +1 -1
- package/dist/{chunk-D3UU546S.js → chunk-EMVWUEW4.js} +1 -1
- package/dist/{chunk-PI25NLDV.js → chunk-EMYZUBWL.js} +1 -1
- package/dist/{chunk-YXCEZAQL.js → chunk-EQPEUPMG.js} +1 -1
- package/dist/{chunk-7Z7JT4HE.js → chunk-EUVLXS2V.js} +1 -1
- package/dist/{chunk-23WNEOK4.js → chunk-FYQXSGRT.js} +1 -1
- package/dist/{chunk-S5H3WJVQ.js → chunk-GLQXJMKL.js} +1 -1
- package/dist/{chunk-5N7QFF5M.js → chunk-HQITRRHF.js} +1 -1
- package/dist/{chunk-UWYL2QCF.js → chunk-HQPP76BS.js} +1 -1
- package/dist/{chunk-EZ5RCVVY.js → chunk-ILEDKSRQ.js} +1 -1
- package/dist/{chunk-2QQZSMTB.js → chunk-KHM6IHPJ.js} +1 -1
- package/dist/{chunk-FJGJQGYF.js → chunk-MIBRUDIS.js} +1 -1
- package/dist/{chunk-WRUW2UIJ.js → chunk-N7YXDSQL.js} +1 -1
- package/dist/{chunk-4ZVVG5LM.js → chunk-NAZU3EEJ.js} +1 -1
- package/dist/{chunk-S57HRPT2.js → chunk-P5K67CKS.js} +1 -1
- package/dist/{chunk-ITVSLSRM.js → chunk-R23IGK5U.js} +1 -1
- package/dist/chunk-R4FDIYMN.js +1 -0
- package/dist/{chunk-LZV4QJ5E.js → chunk-SCC3O2RD.js} +1 -1
- package/dist/{chunk-WK4WQZHK.js → chunk-SP5AQION.js} +1 -1
- package/dist/{chunk-QPHT6QHE.js → chunk-THMGTRXP.js} +1 -1
- package/dist/{chunk-YEXRETKV.js → chunk-UESDHJRB.js} +1 -1
- package/dist/{chunk-TMZGZAWM.js → chunk-UWLEGMWX.js} +1 -1
- package/dist/{chunk-J4VTKRH7.js → chunk-VYFSRHXM.js} +1 -1
- package/dist/{chunk-HJLGRW4A.js → chunk-X4W22IH6.js} +1 -1
- package/dist/{chunk-ZYTT7ZAB.js → chunk-XH7RJPBV.js} +1 -1
- package/dist/{chunk-RBMOWJGE.js → chunk-Y3MQLWGD.js} +1 -1
- package/dist/chunk-ZGCKQWQ5.js +1 -0
- package/dist/chunk-ZIQENZDI.js +1 -0
- package/dist/{content-OY5MRXF5.js → content-YRQSNKN7.js} +1 -1
- package/dist/{funnel-host-purchase-IRFPNIZY.js → funnel-host-purchase-SWYFJOVN.js} +1 -1
- package/dist/{funnel-local-client-D7e3rP5-.d.ts → funnel-local-client-BeGBvi3z.d.ts} +66 -37
- package/dist/{funnel-process-client-BEPv6guV.d.ts → funnel-process-client-C6QKDZun.d.ts} +46 -46
- package/dist/funnel-runtime-host-J2PQHVSO.js +1 -0
- package/dist/index.d.ts +10 -10
- package/dist/index.js +1 -1
- package/dist/merchant-bridge-contracts-ZUQ6SGXZ.js +1 -0
- package/dist/native-shell.js +1 -1
- package/dist/openrouter.d.ts +2 -2
- package/dist/openrouter.js +1 -1
- package/dist/operation-contracts-443N2P3A.js +1 -0
- package/dist/page.js +1 -1
- package/dist/{paywall-DI62MX5L.js → paywall-RQ66UZLW.js} +1 -1
- package/dist/paywall-session-PPECL5XK.js +1 -0
- package/dist/popup.js +1 -1
- package/dist/react-native.d.ts +5 -5
- package/dist/react-native.js +1 -1
- package/dist/screen-renderer-NHLIJDCW.js +1 -0
- package/dist/server.d.ts +64 -52
- package/dist/server.js +1 -1
- package/dist/{visual-dom-32PB6MMP.js → visual-dom-6DCUZGPB.js} +1 -1
- package/dist/visual.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-NH5ML5SB.js +0 -1
- package/dist/chunk-SJSCROSL.js +0 -1
- package/dist/chunk-XIP32WI7.js +0 -1
- package/dist/chunk-XZEGVBAI.js +0 -1
- package/dist/funnel-runtime-host-CJTPLZ4N.js +0 -1
- package/dist/merchant-bridge-contracts-LJKL7PNJ.js +0 -1
- package/dist/operation-contracts-SP2RZUT3.js +0 -1
- package/dist/paywall-session-AW6R3PJB.js +0 -1
- package/dist/screen-renderer-W5MP4KVG.js +0 -1
- /package/dist/{chunk-PWXN3W4Q.js → chunk-BID4UGWB.js} +0 -0
- /package/dist/{chunk-RFUXSC52.js → chunk-UKMEW5I7.js} +0 -0
- /package/dist/{chunk-ZY4XAKNQ.js → chunk-VF6QMMEA.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as ie}from"./chunk-
|
|
1
|
+
import{i as ie}from"./chunk-6KBCR7JJ.js";import{a as Z,c as ee,d as te,e as ne,g as re,h as oe,i as se,k as N}from"./chunk-Y3MQLWGD.js";import{b as X}from"./chunk-EQPEUPMG.js";import{r as V}from"./chunk-NAZU3EEJ.js";import"./chunk-R23IGK5U.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-BXPXJARS.js";import"./chunk-ZIQENZDI.js";import"./chunk-VYFSRHXM.js";import{E as $,P as G,U as R,la as Y,ma as K}from"./chunk-N7YXDSQL.js";import"./chunk-MIBRUDIS.js";import{a as p}from"./chunk-X4W22IH6.js";import"./chunk-R4FDIYMN.js";import"./chunk-CZ2RY6RG.js";import{b as u}from"./chunk-VF6QMMEA.js";import{a as h}from"./chunk-DSPLGTQI.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import"./chunk-WOT6VMZA.js";var z=new WeakMap;function ce(s){let t={string:u.string(),number:u.number().finite(),boolean:u.boolean(),strings:u.array(u.string()),json:R}[s.type];return s.nullable?t.nullable():t}function ae(s,t){let f=u.record(u.string(),R).parse(s);if(Object.keys(f).length>40)throw new p("INVALID_REQUEST","Too many content inputs");for(let[m,r]of Object.entries(f))Y.parse({[m]:r});if(Object.keys(f).some(m=>!Object.hasOwn(t.inputs,m)))throw new p("INVALID_REQUEST","Undeclared content input");for(let[m,r]of Object.entries(t.inputs))if(Object.hasOwn(f,m))ce(r).parse(f[m]);else if(r.required)throw new p("INVALID_REQUEST",`Missing content input ${m}`);return f}async function Ae(s,t){return le(s,t,!1)}async function Se(s,t){return le(s,t,!0)}async function le(s,t,f){t.signal?.throwIfAborted();let m=X.parse(t.content),r=m.document;if(t.closeControl==="content"&&!r.screen.actions.some(e=>e.type==="event"&&e.close))throw new p("INVALID_REQUEST","An authored Close control requires a declared Close action");if(z.has(s))throw new p("CONFLICT","Content is already mounted in this container");let y=ae(t.inputs??{},r.contract),T=new Set(u.array(u.string()).max(40).parse(t.mutableInputs??[]));if(T.size!==(t.mutableInputs?.length??0)||[...T].some(e=>!Object.hasOwn(r.contract.inputs,e)))throw new p("INVALID_REQUEST","Mutable content inputs must name unique declared inputs");for(let e of Object.keys(r.contract.outputs))if(typeof t.actions[e]!="function")throw new p("INVALID_REQUEST",`Missing host handler for ${e}`);let M=K.parse(t.bindings??[]),d=s.ownerDocument,ue=s.clientHeight||d.defaultView?.innerHeight||800,P,w,a,_,x=r.kind==="popup",n=x?d.createElement("dialog"):null,c=d.createElement("div");if(c.dataset.indianaContent=r.kind,c.setAttribute("aria-label",r.name),c.style.cssText="width:100%;min-width:0",n){n.setAttribute("aria-label",r.name);let e=r.screen.presentation;n.style.cssText="box-sizing:border-box;padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto",e.type==="modal"||e.type==="sheet"?(n.style.width=`${$[e.size]}px`,e.type==="sheet"&&(n.style.margin="auto auto 0")):n.style.width="100vw",a=ee(n,r.screen,()=>{w?.resizeViewport(d.defaultView?.innerHeight||800,d.defaultView?.innerWidth||1024)}),n.append(c),s.append(n)}else s.append(c);let i=!1,A=!1,E=!1,S=!1,de=n?oe(n):se(c,s),D=re(s,t,r.kind,()=>{k()&&(b(),h(t.onDismiss))}),q,H,L=new Promise((e,o)=>{q=e,H=o});L.catch(()=>{});let g=null,I=structuredClone(r.screen),W=G(I,[t.locale,...d.defaultView?.navigator.languages??[]]),j=t.capabilities;I.actions=I.actions.map(e=>e.type==="event"?{...e,close:!1}:e);function b(){i||(i=!0,t.signal?.removeEventListener("abort",b),D.finish("dismissed"),H(new Error("Content preparation cancelled")),a?.destroy(),_?.(),w?.destroy(),n?.close(),n?.remove(),c.remove(),z.delete(s),n&&P?.())}let v=()=>{!E||!k()||(b(),h(t.onDismiss))};function k(){try{return t.canDismiss?.()!==!1}catch(e){return h(t.onError,e),!1}}if(n&&t.closeControl!=="content"){let e=d.createElement("button");e.type="button",e.textContent="\xD7",e.setAttribute("aria-label",t.locale?.startsWith("zh")?"\u5173\u95ED":"Close"),ne(e,r.screen.theme),e.addEventListener("click",v),n.prepend(e)}n&&a?.responsive&&(_=Z(n,v,k,t.locale?.startsWith("zh")?"\u5173\u95ED":"Close"),n.addEventListener("click",e=>{if(e.target!==n)return;let o=n.getBoundingClientRect();(e.clientX<o.left||e.clientX>o.right||e.clientY<o.top||e.clientY>o.bottom)&&v()})),n?.addEventListener("cancel",e=>{e.preventDefault(),v()}),n?.addEventListener("keydown",e=>{e.key==="Escape"&&(e.preventDefault(),v())});async function F(){if(i||!E||A||!g)return;let e=g;A=!0,c.setAttribute("aria-busy","true");try{await t.actions[e.actionId](structuredClone(e)),g=null}catch(o){i||h(t.onError,o)}finally{A=!1,i||c.removeAttribute("aria-busy")}}function J(){if(i)throw new p("CONFLICT","Content host has been destroyed");E||!S||(P??=N(d),D.present(e=>{de(),n&&(a?.latch(),n.showModal(),a?.responsive&&n.focus({preventScroll:!0}),!e&&t.loading!=="host"&&te(n,a?.type??r.screen.presentation.type,a?.responsive)),E=!0}))}function U(e){D.finish("error",e),H(e instanceof Error?e:new Error(String(e))),b()}let Q={destroy:b,show:J,get pendingAction(){return g?structuredClone(g):null},retryAction:F,updateInputs(e){if(i)throw new p("CONFLICT","Content host has been destroyed");let o=u.record(u.string(),R).parse(e),C=ae({...y,...o},r.contract);for(let l of Object.keys(o))if(!T.has(l)&&(!Object.hasOwn(y,l)||V(y[l])!==V(C[l])))throw new p("PRECONDITION_FAILED","This content input is frozen; prepare a new presentation");V(y)!==V(C)&&(w?.update(I,W,{capabilities:j,serverInput:{bindings:M,answers:{},values:C}}),y=C)},updateCapabilities(e){if(i)return;let o=structuredClone(e);w?.updateCapabilities(o),j=o}};z.set(s,Q),t.signal?.addEventListener("abort",b,{once:!0});try{if(t.signal?.throwIfAborted(),f||(P=N(d),D.start(x,t.locale??r.screen.strings.defaultLocale),i&&await L),w=ie(c,{mode:"live",rendererUrl:t.rendererUrl,title:r.name,viewportHeight:r.kind==="page"?ue:a?.responsive?d.defaultView?.innerHeight||800:void 0,...a?.responsive?{viewportWidth:d.defaultView?.innerWidth||1024,hostPresentation:()=>a.type}:{},onResize:e=>{i||a?.responsive&&(c.style.height=`${e}px`,c.style.overflow="clip",a.setContentHeight(e))},onRendered:e=>{if(!i&&(e&&n?.setAttribute("aria-label",e),!S))try{S=!0,f||J(),q()}catch(o){U(o),h(t.onError,o)}},onError:e=>{if(i)return;let o=new Error(e);S||U(o),h(t.onError,o)},onEscape:x?v:void 0,onAction:(e,o,C)=>{if(i||!E||A||g)return;let l=r.screen.actions.find(O=>O.id===e),B=r.contract.outputs[e];if(!(l?.type!=="event"||!B)&&!(l.close&&!k()))try{let O=ce(B).parse(Object.hasOwn(l.properties,"value")?l.properties.value:l.properties);g=structuredClone({requestId:crypto.randomUUID(),contentVersionId:m.id,actionId:e,event:l.event,value:O,selection:o??{},answers:C??{},requestedClose:l.close}),F()}catch(O){h(t.onError,O)}}}),w.update(I,W,{capabilities:j,serverInput:{bindings:M,answers:{},values:y}}),await Promise.race([w.ready,L]),f&&await L,i)throw new Error("Content preparation cancelled");return Q}catch(e){throw U(e),e}}export{Ae as mountContent,Se as prepareContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-UESDHJRB.js";import{d as A}from"./chunk-EMYZUBWL.js";import"./chunk-HQPP76BS.js";import{f as g,g as I}from"./chunk-Y3MQLWGD.js";import"./chunk-4XC34JBS.js";import"./chunk-UWLEGMWX.js";import"./chunk-EUVLXS2V.js";import"./chunk-SP5AQION.js";import"./chunk-THMGTRXP.js";import"./chunk-NAZU3EEJ.js";import"./chunk-SCC3O2RD.js";import"./chunk-R23IGK5U.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-EHDHWYVJ.js";import"./chunk-BXPXJARS.js";import"./chunk-ZIQENZDI.js";import"./chunk-VYFSRHXM.js";import"./chunk-N7YXDSQL.js";import"./chunk-MIBRUDIS.js";import{a as c}from"./chunk-X4W22IH6.js";import"./chunk-R4FDIYMN.js";import"./chunk-SLUA7ABW.js";import"./chunk-XH7RJPBV.js";import"./chunk-3VUPVXAV.js";import"./chunk-CZ2RY6RG.js";import"./chunk-VF6QMMEA.js";import{a as i}from"./chunk-DSPLGTQI.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import"./chunk-WOT6VMZA.js";var d=new WeakMap;function T(h,e){let P=d.get(e.client);if(P)return P;let m=Promise.resolve().then(async()=>{let n=!1,s,w,E=!1,v=()=>{},r=e.signal?AbortSignal.any([e.signal,e.client.identitySignal]):e.client.identitySignal,u=()=>{d.get(e.client)===m&&d.delete(e.client),r.removeEventListener("abort",f),v()},o=I(h,e,"funnel",f);function f(){n||(n=!0,o.finish("dismissed"),s?s.destroy():(u(),i(e.onDismiss,null)))}r.addEventListener("abort",f,{once:!0});try{let b=function(){!n&&!r.aborted&&!E&&w&&e.client.recovery.status==="complete"&&(E=!0,i(e.onComplete,structuredClone(w)))};var C=b;r.throwIfAborted(),o.start(!0,e.start?.locale);let l=await o.wait(e.start?e.client.start(e.start):e.client.refresh(),g);r.throwIfAborted();let O=e.client.controller;return l.mode!=="run"||l.status==="blocked"||!O?(o.finish("skipped"),u(),null):(r.removeEventListener("abort",f),v=e.client.subscribe(b),s=await A(h,{...e,client:O,signal:r,checkoutNavigation:"after_confirmation",onCheckoutUrl(t){if(r.throwIfAborted(),n)throw new DOMException("Presentation dismissed","AbortError");if(y(e.client.recovery)!==t)throw new c("PURCHASE_PENDING","Checkout differs from the original recovery proof");return e.onCheckoutUrl?e.onCheckoutUrl(t):h.ownerDocument.defaultView?.location.assign(t)},async resolveOfferId(t){if(r.throwIfAborted(),n)throw new DOMException("Presentation dismissed","AbortError");let a=e.client.attempt;if(!a)throw new c("PURCHASE_PENDING","Read the original Start before selecting an offer");let F=await e.resolveOfferId?.(t,a);if(r.throwIfAborted(),n)throw new DOMException("Presentation dismissed","AbortError");if(e.client.attempt?.requestId!==a.requestId)throw new c("PURCHASE_STORAGE_CONFLICT","The original purchase changed while selecting an offer");return F},onComplete(t){w=t,b()},onError(t){i(e.onError,t),t instanceof c&&t.status===401&&!r.aborted&&e.client.refresh().catch(a=>i(e.onError,a))},onDismiss(t){n=!0,u(),i(e.onDismiss,t)}},o),n||r.aborted?(s.destroy(),null):s)}catch(l){if(n)return null;throw o.finish("error",l),u(),i(e.onError,l),l}});return d.set(e.client,m),m}export{T as showFunnelPurchase};
|