@tinkerlandai/indiana-sdk 0.9.5 → 0.10.2

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 (54) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +30 -41
  3. package/README.zh-CN.md +24 -22
  4. package/dist/{ai-usage-CUTIHAU0.d.ts → ai-usage-Cn7dhvFw.d.ts} +3 -3
  5. package/dist/{api-BXu6TAoB.d.ts → api-DC44FaTV.d.ts} +6354 -904
  6. package/dist/chunk-ACF2FBUB.js +1 -0
  7. package/dist/{chunk-XSOEA4A5.js → chunk-CWHJKWOD.js} +1 -1
  8. package/dist/chunk-EARSGITJ.js +1 -0
  9. package/dist/chunk-FYGXGMRB.js +1 -0
  10. package/dist/chunk-GHJ65ILJ.js +1 -0
  11. package/dist/chunk-JPV7F5XI.js +1 -0
  12. package/dist/{chunk-AOGPGUWE.js → chunk-LCLCG2I2.js} +1 -1
  13. package/dist/chunk-Q64VNSPV.js +6 -0
  14. package/dist/chunk-SBPTOOYB.js +1 -0
  15. package/dist/{chunk-MKV726FV.js → chunk-V3RAOCVQ.js} +1 -1
  16. package/dist/chunk-VZVUZWP2.js +1 -0
  17. package/dist/{chunk-M7JWCLYX.js → chunk-X6BCUINI.js} +1 -1
  18. package/dist/{chunk-4C3HUZ3B.js → chunk-XO42OH3M.js} +1 -1
  19. package/dist/{configuration-sync-DuJl4SbM.d.ts → configuration-sync-CywDxRkX.d.ts} +12 -12
  20. package/dist/{content-PQJYLAGQ.js → content-QM75T7JO.js} +1 -1
  21. package/dist/{funnel-local-client-BhHdi5_V.d.ts → funnel-local-client-DXamAj1-.d.ts} +18475 -2597
  22. package/dist/funnel-node-evaluation-P5B4fPfJ.d.ts +2054 -0
  23. package/dist/{funnel-resource-client-BoIhL_my.d.ts → funnel-resource-client-md62M8Rv.d.ts} +5977 -1126
  24. package/dist/funnel-runtime-host-BJZUVJAI.js +1 -0
  25. package/dist/index.d.ts +9924 -1958
  26. package/dist/index.js +1 -1
  27. package/dist/native-shell.js +1 -1
  28. package/dist/openrouter.d.ts +3 -3
  29. package/dist/openrouter.js +1 -1
  30. package/dist/page.d.ts +4 -4
  31. package/dist/page.js +1 -1
  32. package/dist/paywall-527RPFAX.js +1 -0
  33. package/dist/popup.d.ts +1 -1
  34. package/dist/popup.js +1 -1
  35. package/dist/react-native.d.ts +19930 -7179
  36. package/dist/react-native.js +1 -1
  37. package/dist/{screen-renderer-VAMWY7ID.js → screen-renderer-ZSAR7LPS.js} +1 -1
  38. package/dist/server.d.ts +2737 -573
  39. package/dist/server.js +1 -1
  40. package/dist/visual.d.ts +1 -1
  41. package/dist/visual.js +1 -1
  42. package/package.json +2 -2
  43. package/dist/chunk-5ZWSFE2C.js +0 -1
  44. package/dist/chunk-6ZZUNGNE.js +0 -1
  45. package/dist/chunk-HEGNIATD.js +0 -1
  46. package/dist/chunk-LMO3FXRT.js +0 -1
  47. package/dist/chunk-QYECMZJJ.js +0 -1
  48. package/dist/chunk-UBMPFTGE.js +0 -1
  49. package/dist/chunk-UWFYBRM2.js +0 -6
  50. package/dist/chunk-XRXI3DMZ.js +0 -1
  51. package/dist/funnel-node-evaluation-DuPmqIo1.d.ts +0 -998
  52. package/dist/funnel-runtime-host-3YUGXD3Y.js +0 -1
  53. package/dist/paywall-CSAGKPCP.js +0 -1
  54. package/dist/{screen-CvfI_L41.d.ts → screen-D81zCpfi.d.ts} +2 -2
@@ -1 +0,0 @@
1
- import{b as a}from"./chunk-AOGPGUWE.js";import"./chunk-5ZWSFE2C.js";import"./chunk-UWFYBRM2.js";import"./chunk-HEGNIATD.js";import"./chunk-6ZZUNGNE.js";import"./chunk-4C3HUZ3B.js";import"./chunk-DSPLGTQI.js";import"./chunk-G56XGVMS.js";import"./chunk-LMO3FXRT.js";import"./chunk-7DXL3LHT.js";import"./chunk-3PZ4Y6UD.js";export{a as showFunnelRun};
@@ -1 +0,0 @@
1
- import{b as X}from"./chunk-SSLZKIIU.js";import{I as F}from"./chunk-UWFYBRM2.js";import{J as T,g as z,ka as G,ma as K,oa as h}from"./chunk-HEGNIATD.js";import{a as B}from"./chunk-DSPLGTQI.js";import"./chunk-G56XGVMS.js";import"./chunk-LMO3FXRT.js";import"./chunk-7DXL3LHT.js";import"./chunk-3PZ4Y6UD.js";async function Y(P,t,y){if(t.status!=="complete")throw new h("INVALID_RESPONSE","A verified completed purchase is required");if(await y.onComplete?.(t),!P||!y.check)return;let A=T.parse(await y.check());if(A.internal_feature_id!==P.internal_feature_id||A.quantity!==P.quantity)throw new h("INVALID_RESPONSE","The access requirement changed");A.allowed&&await y.onAccessGranted?.(A)}async function de(P,t){let y=t.check?T.parse(await t.check()):null;if(y?.allowed)return await t.onAccessGranted?.(y),{check:y,host:null};let A=X(P.ownerDocument),n=await t.start(),v=n.view??await n.refresh();if(!v)throw new h("INVALID_RESPONSE","Paywall presentation is missing");let{mountScreenPreview:Z}=await import("./screen-renderer-VAMWY7ID.js"),a=P.ownerDocument,D=new AbortController,C=a.createElement("section"),j=a.createElement("div"),N=a.createElement("div"),R=a.createElement("p"),l=a.createElement("button"),V=a.createElement("button"),u=a.createElement("dialog"),d=v.document.screen.strings.defaultLocale.startsWith("zh");C.dataset.indianaPaywall="",C.setAttribute("aria-label",v.document.name),C.style.cssText="width:100%;box-sizing:border-box;background:#fff;color:#172033;font:14px/1.5 system-ui,sans-serif",N.style.cssText="display:flex;gap:12px;padding:12px 20px;align-items:center;flex-wrap:wrap",R.setAttribute("role","status"),V.textContent=d?"\u5173\u95ED":"Close",l.textContent=d?"\u91CD\u8BD5":"Retry",l.hidden=!0,N.append(R,l,V),C.append(j,N);let U=v.document.presentation,O,p=!1,M=!1,f=null,W=!1,w=()=>!W&&t.canInteract?.()!==!1,$=!1,r=null,_=null,L=e=>{R.textContent=e instanceof Error?e.message:d?"\u8BF7\u6C42\u5931\u8D25":"Request failed",B(t.onError,e),l.hidden=r===null};async function k(e){if(!(M||p||!w())){M=!0,l.hidden=!0,R.textContent="";try{await e()}catch(s){p||L(s)}finally{M=!1}}}async function ee(e){await Y(y,e,t)}async function E(e){if(p)return;if(!w()){r=async()=>E(await n.read()),l.hidden=!1;return}if(R.textContent=e.status,e.status==="complete"){r=null,await ee(e);return}if(e.status!=="pending"){if(n.canReselect===!1){R.textContent=d?"\u6B63\u5728\u6838\u5BF9\u539F\u8D2D\u4E70\u7ED3\u679C":"Checking the original purchase result",l.textContent=d?"\u67E5\u8BE2\u7ED3\u679C":"Check result",r=async()=>E(await n.read()),l.hidden=!1;return}l.textContent=d?"\u91CD\u8BD5":"Retry",r=null,f=null;return}let s=Date.now()+6e5,c=2e3;for(;!p&&Date.now()<s;){if(await new Promise(m=>{let b=()=>{clearTimeout(g),m()},g=setTimeout(()=>{D.signal.removeEventListener("abort",b),m()},c);D.signal.addEventListener("abort",b,{once:!0})}),p)return;if(!w()){r=async()=>E(await n.read()),l.hidden=!1;return}let i=await n.read();if(i.status!=="pending"){await E(i);return}c=Math.min(c*1.5,3e4)}r=async()=>E(await n.read()),l.hidden=!1}async function Q(){_?.remove(),_=null,r=Q;let e=await n.confirm();if(!w()){r=Q,l.hidden=!1;return}if(e.status==="pending"){if(e.checkoutUrl)t.onCheckoutUrl?await t.onCheckoutUrl(e.checkoutUrl):a.defaultView?.location.assign(e.checkoutUrl);else if(e.execution||e.nativePurchase){if(!t.onPurchase)throw new h("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await t.onPurchase({operation:e,signal:D.signal})}}r=async()=>E(await n.read()),await E(e)}function te(e){_?.remove();let s=a.createElement("div"),c=a.createElement("button"),i=a.createElement("button"),m=a.createElement("p");m.textContent=e.lines.map(o=>o.productName).join(", ")+" \xB7 "+z(e.charge?.totalMinor??e.catalogAmountMinor-(e.discount?.amountMinor??0),e.currency),c.textContent=d?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",i.textContent=d?"\u53D6\u6D88":"Cancel",c.onclick=()=>{k(Q)};let b=async()=>{let o=await n.cancel();p||(s.remove(),_=null,await E(o))};i.onclick=()=>{r=b,k(b)};let g=a.createElement("div");for(let o of e.lines){let J=a.createElement("p");J.textContent=`${o.productName} \xB7 ${z(o.catalogAmountMinor,e.currency)}${G(o.interval,d?"zh-CN":"en",o.intervalCount??1)}`,g.append(J);for(let I of o.prepaid??[]){let H=a.createElement("p"),x=n.view?.capabilities.plans[o.productVersionId]?.prepaid?.find(ne=>ne.internalFeatureId===I.internal_feature_id);H.textContent=`${x?.name??I.internal_feature_id} \xB7 ${I.quantity} ${d?"\u4EFD":"packs"} \xD7 ${I.terms.units}`,x&&(H.textContent+=G(x.reset==="week"||x.reset==="month"||x.reset==="year"?x.reset:"one_time",d?"zh-CN":"en",x.resetCount)),g.append(H)}if(o.trial){let I=a.createElement("p");I.textContent=d?`\u8BD5\u7528 ${o.trial.days} \u5929\uFF1B${o.trial.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${o.trial.days}; ${o.trial.cardRequired?"a payment method is required":"no payment method is required"}`,g.append(I)}}if(!e.charge){let o=a.createElement("p");o.textContent=d?"\u76EE\u5F55\u4EF7\u683C\uFF1B\u6700\u7EC8\u91D1\u989D\u4EE5\u7ED3\u8D26\u65F6\u7A0E\u8D39\u548C\u8BD5\u7528\u89C4\u5219\u4E3A\u51C6\u3002":"Catalog price; the final charge depends on checkout taxes and trial terms.",g.append(o)}s.append(m,g,c,i),N.prepend(s),_=s,r=null}async function q(){if(!f)return;if(r=q,!$){let s=n.view,c=s?.document.buttons[f.actionId],i=s&&c?.type==="checkout"?F(c.product,f.selection,s.capabilities):null;if(!i)throw new h("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let m=await t.resolveOfferId?.({actionId:f.actionId,productVersionId:i});if(p)return;m!==void 0&&(f.offerId=m),$=!0}if(!w()){l.hidden=!1;return}let e=await n.preview(f);p||te(e)}function S(e="destroy"){p||(p=!0,D.abort(),O?.destroy(),n.destroy(),u.open&&u.close(),u.remove(),C.remove(),A(),e==="dismiss"&&B(t.onDismiss))}V.onclick=()=>{w()&&S("dismiss")},u.addEventListener("cancel",e=>{e.preventDefault(),w()&&S("dismiss")}),l.onclick=()=>{r&&k(r)};try{if(U.type==="inline")P.append(C);else{let e={sm:420,md:640,lg:900};u.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in U?e[U.size]+"px":"100vw"}`,u.setAttribute("aria-label",v.document.name),u.append(C),P.append(u),w()&&u.showModal()}O=Z(j,{mode:"live",rendererUrl:n.webViewUrl,title:v.document.name,onAction(e,s={}){if(!w())return;let c=n.view,i=c?.document.buttons[e];if(!i)return;if(i.type==="close"){k(async()=>{await t.onAction?.(e),S(t.onAction?"action":"dismiss")});return}if(i.type==="action"){r=async()=>{if(i.action.type==="event"){if(!t.onEvent)throw new h("EVENT_HANDLER_REQUIRED","Provide the event handler");await t.onEvent(i.action.event)}else t.onOpenUrl?await t.onOpenUrl(i.action.url):a.defaultView?.location.assign(i.action.url);await t.onAction?.(e),r=null},k(r);return}if((n.quote||f)&&n.canReselect===!1){r=n.quote?async()=>E(await n.read()):q,k(r);return}let m=c&&F(i.product,s,c.capabilities);if(!c||!m){L(new h("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(t.onPurchaseIntent){r=null,k(async()=>{let b={actionId:e,productVersionId:m,selection:structuredClone(s),featureQuantities:K(c.document.screen,m,s,c.capabilities)};await t.onPurchaseIntent(b)});return}if(f&&f.actionId!==e){L(new h("COMMAND_PENDING","Finish the current purchase"));return}f||(f={requestId:crypto.randomUUID(),actionId:e,selection:s},$=!1),k(q)},onEscape:()=>{w()&&S("dismiss")},onError:e=>L(new Error(e))}),O.update(v.document.screen,v.document.screen.strings.defaultLocale,{capabilities:v.capabilities,serverInput:{bindings:[],answers:{}}}),await O.ready}catch(e){throw S(),e}return{check:y,host:{setSuspended(e){W=e,C.hidden=e,e&&u.open?u.close():!e&&!p&&U.type!=="inline"&&!u.open&&u.showModal()},destroy:S,refresh:async()=>{if(!w()){if(n.view)return n.view;throw new h("PRECONDITION_FAILED","Paywall presentation is suspended")}let e=await n.refresh();return p||O?.updateCapabilities(e.capabilities),e}}}}export{de as showPaywall};
@@ -2917,10 +2917,10 @@ declare const screenDocumentShape: z.ZodObject<{
2917
2917
  text: z.ZodString;
2918
2918
  radius: z.ZodEnum<{
2919
2919
  none: "none";
2920
+ full: "full";
2920
2921
  sm: "sm";
2921
2922
  md: "md";
2922
2923
  lg: "lg";
2923
- full: "full";
2924
2924
  }>;
2925
2925
  font: z.ZodEnum<{
2926
2926
  system: "system";
@@ -2939,10 +2939,10 @@ declare const screenDocumentShape: z.ZodObject<{
2939
2939
  text: z.ZodString;
2940
2940
  radius: z.ZodEnum<{
2941
2941
  none: "none";
2942
+ full: "full";
2942
2943
  sm: "sm";
2943
2944
  md: "md";
2944
2945
  lg: "lg";
2945
- full: "full";
2946
2946
  }>;
2947
2947
  font: z.ZodEnum<{
2948
2948
  system: "system";