@buoy-gg/shared-ui 7.0.75 → 7.0.77
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/lib/commonjs/bugCase/capture.js +1 -0
- package/lib/commonjs/bugCase/format.js +3 -0
- package/lib/commonjs/bugCase/index.js +1 -0
- package/lib/commonjs/bugCase/lock.js +1 -0
- package/lib/commonjs/bugCase/recorder.js +1 -0
- package/lib/commonjs/bugCase/scrub.js +1 -0
- package/lib/commonjs/bugCase/steps.js +1 -0
- package/lib/commonjs/bugCase/types.js +1 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/license/AccountSetupContent.js +1 -1
- package/lib/commonjs/license/licenseModule.js +1 -1
- package/lib/commonjs/storage/devToolsStorageKeys.js +1 -1
- package/lib/commonjs/utils/appIdentity.js +1 -0
- package/lib/commonjs/utils/index.js +1 -1
- package/lib/commonjs/utils/minimalSuperJSON.js +1 -1
- package/lib/commonjs/utils/nativeWeb.js +1 -1
- package/lib/commonjs/utils/reloadPlatform.js +1 -1
- package/lib/module/bugCase/capture.js +1 -0
- package/lib/module/bugCase/format.js +3 -0
- package/lib/module/bugCase/index.js +1 -0
- package/lib/module/bugCase/lock.js +1 -0
- package/lib/module/bugCase/recorder.js +1 -0
- package/lib/module/bugCase/scrub.js +1 -0
- package/lib/module/bugCase/steps.js +1 -0
- package/lib/module/bugCase/types.js +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/license/AccountSetupContent.js +1 -1
- package/lib/module/license/licenseModule.js +1 -1
- package/lib/module/storage/devToolsStorageKeys.js +1 -1
- package/lib/module/utils/appIdentity.js +1 -0
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/minimalSuperJSON.js +1 -1
- package/lib/module/utils/nativeWeb.js +1 -1
- package/lib/module/utils/reloadPlatform.js +1 -1
- package/lib/typescript/commonjs/bugCase/capture.d.ts +20 -0
- package/lib/typescript/commonjs/bugCase/format.d.ts +15 -0
- package/lib/typescript/commonjs/bugCase/index.d.ts +14 -0
- package/lib/typescript/commonjs/bugCase/lock.d.ts +99 -0
- package/lib/typescript/commonjs/bugCase/recorder.d.ts +8 -0
- package/lib/typescript/commonjs/bugCase/scrub.d.ts +59 -0
- package/lib/typescript/commonjs/bugCase/steps.d.ts +44 -0
- package/lib/typescript/commonjs/bugCase/types.d.ts +92 -0
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -1
- package/lib/typescript/commonjs/license/AccountSetupContent.d.ts +1 -1
- package/lib/typescript/commonjs/license/licenseModule.d.ts +7 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +14 -0
- package/lib/typescript/commonjs/utils/appIdentity.d.ts +3 -0
- package/lib/typescript/commonjs/utils/index.d.ts +1 -1
- package/lib/typescript/commonjs/utils/minimalSuperJSON.d.ts +6 -0
- package/lib/typescript/commonjs/utils/nativeWeb.d.ts +8 -1
- package/lib/typescript/module/bugCase/capture.d.ts +20 -0
- package/lib/typescript/module/bugCase/format.d.ts +15 -0
- package/lib/typescript/module/bugCase/index.d.ts +14 -0
- package/lib/typescript/module/bugCase/lock.d.ts +99 -0
- package/lib/typescript/module/bugCase/recorder.d.ts +8 -0
- package/lib/typescript/module/bugCase/scrub.d.ts +59 -0
- package/lib/typescript/module/bugCase/steps.d.ts +44 -0
- package/lib/typescript/module/bugCase/types.d.ts +92 -0
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +3 -1
- package/lib/typescript/module/license/AccountSetupContent.d.ts +1 -1
- package/lib/typescript/module/license/licenseModule.d.ts +7 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +14 -0
- package/lib/typescript/module/utils/appIdentity.d.ts +3 -0
- package/lib/typescript/module/utils/index.d.ts +1 -1
- package/lib/typescript/module/utils/minimalSuperJSON.d.ts +6 -0
- package/lib/typescript/module/utils/nativeWeb.d.ts +8 -1
- package/lib/web/chunks/{chunk-7CBB7NEY.mjs → chunk-4QFANR3K.mjs} +1 -1
- package/lib/web/chunks/{chunk-UQRRKDKX.mjs → chunk-BMITMQVB.mjs} +3 -3
- package/lib/web/chunks/chunk-DJD42EPL.mjs +1 -0
- package/lib/web/chunks/chunk-EY7GXWGI.mjs +1 -0
- package/lib/web/chunks/{chunk-RMLVR5LI.mjs → chunk-FPMEM2QO.mjs} +1 -1
- package/lib/web/chunks/{chunk-G2SCTDOW.mjs → chunk-GN75GBYZ.mjs} +1 -1
- package/lib/web/chunks/{chunk-3HELV44Y.mjs → chunk-GTRVOJUH.mjs} +1 -1
- package/lib/web/chunks/{chunk-G27JNYZ3.mjs → chunk-OF3VWR6K.mjs} +1 -1
- package/lib/web/chunks/{chunk-CJTGUGMQ.mjs → chunk-OVTASJUJ.mjs} +1 -1
- package/lib/web/chunks/chunk-QXVVA64P.mjs +1 -0
- package/lib/web/chunks/{chunk-HIAN3HBD.mjs → chunk-XUYN4NOF.mjs} +1 -1
- package/lib/web/chunks/{persistentStorage.web-24PEE4I7.mjs → persistentStorage.web-7JL3GE3F.mjs} +1 -1
- package/lib/web/dataViewer.mjs +1 -1
- package/lib/web/history.mjs +1 -1
- package/lib/web/hooks.mjs +1 -1
- package/lib/web/index.mjs +7 -3
- package/lib/web/native.mjs +1 -1
- package/lib/web/ui.mjs +1 -1
- package/lib/web/utils.mjs +1 -1
- package/package.json +5 -5
- package/lib/web/chunks/chunk-2STKTXD3.mjs +0 -1
- package/lib/web/chunks/chunk-4HIK66DZ.mjs +0 -1
- package/lib/web/chunks/chunk-5G6RSRP4.mjs +0 -1
- package/lib/web/chunks/chunk-GMM6TGFO.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{BUG_CASE_VERSION as E}from"./types.js";export const BUG_CASE_LOCK_FORMAT=1;const h=[66,85,79,89,66,85,71];const d=32;const u=12;const w=16;const p=h.length+1+4;const T=4096;export const MAX_BUG_CASE_BYTES=24*1024*1024;export class BugCaseLockError extends Error{constructor(t,r){super(r);this.code=t;this.name="BugCaseLockError"}}export function bugCaseHeader(e,t){return{v:BUG_CASE_LOCK_FORMAT,case:e.v,createdAt:String(e.createdAt),platform:String(e.app?.platform??""),os:String(e.app?.os??""),bytes:t,steps:e.steps?.length??0,calls:e.network?.length??0,errors:e.console?.filter(r=>r.level==="error").length??0,removed:e.scrub?.removed??0,missing:e.missing?.length??0}}export async function lockBugCase(e,t=webCaseCrypto(),r={}){const n=A(JSON.stringify(e));if(n.length>MAX_BUG_CASE_BYTES){throw new BugCaseLockError("too_big",`This case is ${n.length} bytes. The most is ${MAX_BUG_CASE_BYTES}.`)}const o=bugCaseHeader(e,n.length);const a=A(JSON.stringify(o));const s=r.key?base64UrlDecode(r.key):t.randomBytes(d);if(r.key&&(!s||s.length!==d))throw new BugCaseLockError("bad_link","That key is cut off or changed.");const c=t.randomBytes(u);x(s,d);x(c,u);const i=g([Uint8Array.from(h),Uint8Array.of(BUG_CASE_LOCK_FORMAT),C(a.length),a,c]);const l=await t.seal(s,c,await t.gzip(n),i);return{blob:g([i,l]),key:r.key??base64UrlEncode(s),header:o}}export function readBugCaseHeader(e){return m(e).header}export async function unlockBugCase(e,t,r={}){const n=m(e);const o=base64UrlDecode(t);if(!o||o.length!==d)throw new BugCaseLockError("bad_link","The key in this link is cut off or changed.");const a=r.crypto??webCaseCrypto();let s;try{s=await a.open(o,n.nonce,n.sealed,n.aad)}catch{throw new BugCaseLockError("locked","This case won't open. The key is wrong, or the case was changed.")}let c;try{c=await a.gunzip(s,r.maxBytes??MAX_BUG_CASE_BYTES)}catch(l){if(l instanceof BugCaseLockError)throw l;throw new BugCaseLockError("bad_blob","This case opened but won't unzip.")}let i;try{i=JSON.parse(S(c))}catch{throw new BugCaseLockError("bad_blob","This case opened but isn't JSON.")}if(!i||typeof i!=="object"||i.v!==E){throw new BugCaseLockError("bad_blob","This case was made by a newer Buoy, or isn't a bug case.")}return{header:n.header,kase:i}}const _=/^[A-Za-z0-9_-]{8,64}$/;export function bugLinkUrl(e,t,r){return`${e.replace(/\/+$/,"")}/bug/${t}#${r}`}export function parseBugLink(e){const t=/\/bug\/([^/?#]+)\/?(?:\?[^#]*)?#(.+)$/.exec(e.trim());if(!t||!_.test(t[1]))return null;const r=base64UrlDecode(t[2]);return r&&r.length===d?{id:t[1],key:t[2]}:null}export function webCaseCrypto(){const e=globalThis;const t=e.crypto?.subtle;const r=e.crypto?.getRandomValues?.bind(e.crypto);if(!t||!r||!e.CompressionStream||!e.DecompressionStream){throw new BugCaseLockError("no_crypto","This platform has no WebCrypto. Pass the phone's own crypto.")}const n=e.CompressionStream;const o=e.DecompressionStream;const a=(s,c)=>t.importKey("raw",s,"AES-GCM",false,[c]);return{randomBytes:s=>r(new Uint8Array(s)),seal:async(s,c,i,l)=>new Uint8Array(await t.encrypt({name:"AES-GCM",iv:c,additionalData:l},await a(s,"encrypt"),i)),open:async(s,c,i,l)=>new Uint8Array(await t.decrypt({name:"AES-GCM",iv:c,additionalData:l},await a(s,"decrypt"),i)),gzip:s=>y(s,new n("gzip"),Infinity),gunzip:(s,c)=>y(s,new o("gzip"),c)}}async function y(e,t,r){const n=t.writable.getWriter();n.write(e).then(()=>n.close()).catch(()=>{});const o=t.readable.getReader();const a=[];let s=0;for(;;){const{done:c,value:i}=await o.read();if(c)break;s+=i.length;if(s>r){await o.cancel().catch(()=>{});throw new BugCaseLockError("too_big",`This case unzips past ${r} bytes.`)}a.push(i)}return g(a)}function m(e){const t=c=>new BugCaseLockError("bad_blob",`This isn't a bug case: ${c}.`);if(!(e instanceof Uint8Array)||e.length<p+u+w)throw t("too short");for(let c=0;c<h.length;c++)if(e[c]!==h[c])throw t("no Buoy mark");if(e[h.length]!==BUG_CASE_LOCK_FORMAT)throw t(`format ${e[h.length]} is newer than this Buoy`);const r=h.length+1;const n=(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0;const o=p+n;if(n>T||o+u+w>e.length)throw t("header size");let a;try{a=JSON.parse(S(e.subarray(p,o)))}catch{throw t("header isn't JSON")}const s=B(a);if(!s)throw t("header shape");return{header:s,aad:e.subarray(0,o+u),nonce:e.subarray(o,o+u),sealed:e.subarray(o+u)}}function B(e){if(!e||typeof e!=="object")return null;const t=e;const r=a=>Number.isSafeInteger(t[a])&&t[a]>=0?t[a]:null;const n=(a,s)=>typeof t[a]==="string"&&t[a].length<=s?t[a]:null;const o={v:t.v===BUG_CASE_LOCK_FORMAT?BUG_CASE_LOCK_FORMAT:null,case:r("case"),createdAt:n("createdAt",40),platform:n("platform",20),os:n("os",40),bytes:r("bytes"),steps:r("steps"),calls:r("calls"),errors:r("errors"),removed:r("removed"),missing:r("missing")};return Object.values(o).every(a=>a!==null)?o:null}function x(e,t){if(!(e instanceof Uint8Array)||e.length!==t||e.every(r=>r===e[0])){throw new BugCaseLockError("no_crypto","The random source gave bad bytes, so the case was not locked.")}}function C(e){return Uint8Array.of(e>>>24&255,e>>>16&255,e>>>8&255,e&255)}function g(e){const t=new Uint8Array(e.reduce((n,o)=>n+o.length,0));let r=0;for(const n of e){t.set(n,r);r+=n.length}return t}const f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";const b=(()=>{const e=new Int16Array(128).fill(-1);for(let t=0;t<f.length;t++)e[f.charCodeAt(t)]=t;return e})();export function base64UrlEncode(e){const t=[];let r="";for(let n=0;n<e.length;n+=3){const o=e[n]<<16|(e[n+1]??0)<<8|(e[n+2]??0);r+=f[o>>18&63]+f[o>>12&63];if(n+1<e.length)r+=f[o>>6&63];if(n+2<e.length)r+=f[o&63];if(r.length>=8192){t.push(r);r=""}}t.push(r);return t.join("")}export function base64UrlDecode(e){if(e.length%4===1)return null;const t=new Uint8Array(Math.floor(e.length*3/4));let r=0;let n=0;let o=0;for(let a=0;a<e.length;a++){const s=e.charCodeAt(a);const c=s<128?b[s]:-1;if(c<0)return null;n=(n<<6|c)&16777215;r+=6;if(r>=8){r-=8;t[o++]=n>>r&255}}return t}function A(e){if(typeof TextEncoder!=="undefined")return new TextEncoder().encode(e);const t=[];for(const r of e){const n=r.codePointAt(0);if(n<128)t.push(n);else if(n<2048)t.push(192|n>>6,128|n&63);else if(n<65536)t.push(224|n>>12,128|n>>6&63,128|n&63);else t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|n&63)}return Uint8Array.from(t)}function S(e){if(typeof TextDecoder!=="undefined")return new TextDecoder("utf-8",{fatal:true}).decode(e);const t=[];for(let n=0;n<e.length;){const o=e[n++];const a=o>=240?3:o>=224?2:o>=192?1:0;let s=a?o&63>>a:o;for(let c=0;c<a;c++)s=s<<6|e[n++]&63;t.push(s)}let r="";for(let n=0;n<t.length;n+=8192)r+=String.fromCodePoint(...t.slice(n,n+8192));return r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{dispatchToolAction as r,getToolAdapters as c}from"../sync/toolActionRegistry.js";const i=["network","console","route-events"];let o=[];let e=false;export async function startBugCaseRecorder(){if(!o.length){const t=[];for(const u of i){const s=c()[u]?.subscribe;if(typeof s!=="function")continue;try{const n=s(()=>{});if(typeof n==="function")t.push(n)}catch{}}o=t}if(!e&&c()["highlight-updates"]){try{const t=await r("highlight-updates","startTouchCapture");e=t?.status==="capturing"}catch{}}return bugCaseRecorderStatus()}export function stopBugCaseRecorder(){o.forEach(t=>t());o=[];if(e){r("highlight-updates","stopTouchCapture").catch(()=>{});e=false}}export function bugCaseRecorderStatus(){return{watching:o.length?i.filter(t=>typeof c()[t]?.subscribe==="function"):[],touches:e}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const removedMark=o=>`[removed:${o}]`;export const REMOVED_MARK=/\[removed:(?:secret|pii)\]/;export class ScrubLimitError extends Error{}const H=200;const J=6;const D=64;const z=5e5;const G=5;export function keyWords(o){return o.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map(i=>i.toLowerCase())}const j=new Set(["password","passwd","pwd","pw","passcode","secret","cookie","credential","credentials","cvv","cvc","ssn","otp","signature","bearer","authorization","jwt","mnemonic","seed"]);const K=new Set(["token","session","sid","pin","auth","refresh"]);const U=new Set(["api","private","secret","signing","biometric","encryption","access","session","device","license","licence","buoy"]);const V=new Set(["next","page","continuation","cursor","prev","sync"]);const Y=new Set(["email","phone","mobile","birthday","dob","birthdate","address","street","lat","lng","latitude","longitude","iban","firstname","lastname","ip"]);const W=new Set(["username","login"]);const X=new Set(["full","first","last","user","display"]);const F=new Set(["user","profile","customer","contact","account","me","member","owner","recipient"]);const Q=new Set(["card","payment","cc"]);const q=new Set(["exp","expiry","expiration","pan","number","cvv","cvc","csc"]);export function classifyKey(o){const i=keyWords(o);if(!i.length)return null;const n=i[i.length-1];const a=i.slice(0,-1);if(i.some(u=>j.has(u)))return"secret";if(n==="token"&&a.some(u=>V.has(u)))return null;if(K.has(n))return"secret";if(n==="id"&&a.includes("session"))return"secret";if(n==="key"&&a.some(u=>U.has(u)))return"secret";if(i.some(u=>Y.has(u)))return"pii";if(W.has(n))return"pii";if(n==="name"&&a.some(u=>X.has(u)))return"pii";return null}function v(o,i,n){const a=keyWords(o);const u=a[a.length-1];if(!u)return null;const k=keyWords(i??"");const S=k.some(g=>Q.has(g))||Object.values(n).some(g=>typeof g==="string"&&P(g));if(S&&q.has(u))return"secret";const d=k.some(g=>F.has(g));if(d&&a.length===1&&["name","username","login","handle"].includes(u))return"pii";return null}function ee(o){let i=0;for(let n=0;n<o.length;n++){let a=Number(o[o.length-1-n]);if(n%2){a*=2;if(a>9)a-=9}i+=a}return i%10===0}function P(o){const i=o.replace(/[ -]/g,"");return/^\d{13,19}$/.test(i)&&ee(i)}const te=[["secret",/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g],["secret",/\beyJ[\w-]{6,}\.[\w-]{6,}\.[\w-]{6,}/g],["secret",/\beyJ(?:hbGci|0eXAi|raWQi)[A-Za-z0-9_-]{8,}/g],["secret",/\b(?:Bearer|Basic|Token)\s+[\w\-.=+/~]{8,}/g],["secret",/\b(?:sk|rk)_(?:live|test)_\w{10,}/g],["secret",/\bsk-[A-Za-z0-9-]{16,}/g],["secret",/\bpk\.eyJ[\w-]+\.[\w-]+/g],["secret",/\bAIza[\w-]{20,}/g],["secret",/\bgh[pousr]_[A-Za-z0-9]{20,}/g],["secret",/\bxox[abpr]-[\w-]{10,}/g],["secret",/\bAKIA[0-9A-Z]{12,}/g],["secret",/ExponentPushToken\[[^\]]+\]/g],["secret",/\/services\/T\w+\/B\w+\/\w+/g],["secret",/\b\d{3}-\d{2}-\d{4}\b/g],["secret",/\bBUOY-[A-Z0-9-]{8,}/g],["secret",/\b[A-F0-9]{6}(?:-[A-F0-9]{6}){4}-V\d\b/g],["pii",/[\w.+-]+(?:@|%40)[\w-]+(?:\.[\w-]+)+/g],["pii",/\b[A-Z]{2}\d{2}[A-Z0-9]{11,30}\b/g]];const re=/^(?:Bearer|Basic|Token)\s+/i;const ne=/\b(?:\d[ -]?){13,19}\b/g;const se=/(["']?[A-Za-z0-9_.-]{0,48}(?:authorization|api[_-]?key|password|passwd|secret|access[_-]?token|refresh[_-]?token|auth[_-]?token|session[_-]?token|license[_-]?key|licence[_-]?key|buoy[_-]?key|private[_-]?key)["']?\s*[:=]\s*["']?)(?!(?:authorization|bearer|cookie|header|\[removed)\b)([^\s"',}]{6,})/gi;const oe=/(?:\+\d{1,3}[\s.-]?)?\(?\b\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}\b/g;const ce=/(?:authorization|api[_-]?key|password|passwd|secret|token|licen[cs]e[_-]?key|buoy[_-]?key|private[_-]?key)["']?\s*[:=]/i;const ie=/[@=%]|BUOY-|\d{3}|eyJ|Bearer|Basic|Token|sk[-_]|rk_|AIza|gh[pousr]_|xox|AKIA|Exponent|services\/|-----BEGIN/;const ae=/^(?:x-amz-(?:signature|credential|security-token)|signature|sig|token|access_token|id_token|api_key|apikey|key|code|password|secret)$/i;const ue=/^(?:authorization|proxy-authorization|cookie|set-cookie|x-api-key|x-auth-token|x-csrf-token|x-xsrf-token|x-amz-security-token)$/i;function le(o){const i=[];for(const n of o.split(/[;,]\s*/)){const a=n.replace(/^(?:Bearer|Basic|Token)\s+/i,"").trim();const u=/^[A-Za-z0-9_.-]+=(.+)$/.exec(a);for(const k of u&&!a.endsWith("=")?[u[1],a]:[a]){if(k.length>=J&&!REMOVED_MARK.test(k))i.push(k)}}return i}function B(o){try{return decodeURIComponent(o)}catch{return o}}export function setOwn(o,i,n){Object.defineProperty(o,i,{value:n,enumerable:true,writable:true,configurable:true})}function Z(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(o){return/^\s*[[{]/.test(o)}export function scrubBugCase(o,i={}){const n=[];const a=new Set;const u=new Set;const k=new Set(i.keep??[]);const S=new Set(i.redact??[]);const d=(e,c)=>{if(typeof e!=="string"&&typeof e!=="number")return;const t=String(e);if(c==="secret")le(t).forEach(r=>a.add(r));else if(t.length>=G&&u.size<H)u.add(t)};const g=(e,c)=>{let t=e;if(/^https?:\/\//.test(t)){t=t.replace(/([?&])([^=&#\s]+)=([^&#\s]*)/g,(r,s,l)=>{if(!ae.test(B(l)))return r;n.push({path:c,kind:"secret",rule:"param"});d(B(r.slice(r.indexOf("=")+1)),"secret");return`${s}${l}=${removedMark("secret")}`})}if(t.length>=6&&ce.test(t)){t=t.replace(se,(r,s,l)=>{n.push({path:c,kind:"secret",rule:"value"});d(l,"secret");return`${s}${removedMark("secret")}`})}if(t.length<6||!ie.test(t))return t;t=t.replace(ne,r=>{if(!P(r))return r;n.push({path:c,kind:"secret",rule:"value"});return removedMark("secret")});for(const[r,s]of te){t=t.replace(s,l=>{n.push({path:c,kind:r,rule:"value"});if(re.test(l))d(l,"secret");return removedMark(r)})}return t.replace(oe,r=>{if(!/[\s().+-]/.test(r))return r;n.push({path:c,kind:"pii",rule:"value"});return removedMark("pii")})};let L=0;const I=e=>{if(++L>z)throw new ScrubLimitError(`case has over ${z} values`);if(e>D)throw new ScrubLimitError(`case is nested over ${D} deep`)};const x=(e,c,t=0)=>{I(t);if(e&&typeof e==="object"){if(Array.isArray(e))return e.map((s,l)=>x(s,`${c}[${l}]`,t+1));const r={};for(const[s,l]of Object.entries(e))setOwn(r,s,x(l,`${c}.${s}`,t+1));return r}if(e===null||e===void 0||typeof e==="boolean")return e;n.push({path:c,kind:"secret",rule:"key"});d(e,"secret");return removedMark("secret")};const $=(e,c,t,r=0)=>{I(r);if(typeof e==="string"){if(M(e)){try{return JSON.stringify($(JSON.parse(e),`${c}<json>`,t,r+1))}catch{}}return g(e,c)}if(!e||typeof e!=="object")return e;if(Array.isArray(e)){if(e.length===2&&typeof e[0]==="string"&&(e[1]===null||typeof e[1]!=="object")){const h=classifyKey(e[0]);if(h&&e[1]!=null){n.push({path:`${c}[1]`,kind:h,rule:"key"});d(e[1],h);return[e[0],removedMark(h)]}}return e.map((h,p)=>$(h,`${c}[${p}]`,t,r+1))}const s=e;const l=/headers$/i.test(t??"");const y=typeof(s.key??s.name)==="string"&&"value"in s?String(s.key??s.name):null;const b={};for(const[h,p]of Object.entries(s)){const f=g(h,`${c}<key>`);const A=`${c}.${f}`;const _=y&&f==="value"?y:f;if(k.has(_)){setOwn(b,f,p);continue}if(S.has(_)||S.has(A.replace(/^\$\./,""))){n.push({path:A,kind:"pii",rule:"app"});setOwn(b,f,removedMark("pii"));continue}if(l&&ue.test(f)){n.push({path:A,kind:"secret",rule:"header"});if(typeof p==="string")d(p,"secret");setOwn(b,f,removedMark("secret"));continue}const m=classifyKey(_)??v(_,t,s);if(m==="secret"&&p&&typeof p==="object"&&keyWords(_).some(C=>j.has(C))){setOwn(b,f,x(p,A));continue}if(m&&(p===null||typeof p!=="object")){n.push({path:A,kind:m,rule:"key"});d(p,m);setOwn(b,f,removedMark(m));continue}setOwn(b,f,$(p,A,f,r+1))}return b};let N=$(o,"$",null);const R=(e,c)=>c.length-e.length;const O=[...a].sort(R).map(Z);const T=[...u].filter(e=>!a.has(e)).sort(R).map(Z);const E=O.length?new RegExp(O.join("|"),"g"):null;const w=T.length?new RegExp(`(^|[^\\w@.])(?:${T.join("|")})(?![\\w@])`,"g"):null;if(E||w){const e=(t,r)=>{let s=t;if(E&&(E.lastIndex=0,E.test(s))){s=s.replace(E,()=>{n.push({path:r,kind:"secret",rule:"learned"});return removedMark("secret")})}if(w&&(w.lastIndex=0,w.test(s))){s=s.replace(w,(l,y)=>{n.push({path:r,kind:"pii",rule:"learned"});return`${y}${removedMark("pii")}`})}return s};const c=(t,r)=>{if(typeof t==="string"){if(M(t)){try{return JSON.stringify(c(JSON.parse(t),`${r}<json>`))}catch{}}return e(t,r)}if(!t||typeof t!=="object")return t;if(Array.isArray(t))return t.map((l,y)=>c(l,`${r}[${y}]`));const s={};for(const[l,y]of Object.entries(t)){setOwn(s,e(l,`${r}<key>`),c(y,`${r}.${l}`))}return s};N=c(N,"$")}return{value:N,removed:n}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=2e3;function $(e){return(e.text||e.label||e.testID||e.name||"something").trim()}export function safeTouch(e){const s=e.kind==="text"||e.target.control==="text";if(!s)return e;const r=typeof e.value==="string"?e.value.length:0;const{value:u,...i}=e.target;return{...e,target:i,value:r}}function x(e){const s=`"${$(e.target)}"`;switch(e.kind){case"longPress":return`Long-pressed ${s}`;case"text":{const r=typeof e.value==="number"?e.value:0;return r===0?`Cleared ${s}`:`Typed ${r} character${r===1?"":"s"} into ${s}`}case"toggle":return`Turned ${e.value?"on":"off"} ${s}`;case"slider":return`Set ${s} to ${String(e.value)}`;default:return`Tapped ${s}`}}export function bugCaseSteps(e,s=[]){const r=e.map((t,o)=>({touch:safeTouch(t),i:o})).sort((t,o)=>(t.touch.seq??t.i)-(o.touch.seq??o.i));const u=[...s].sort((t,o)=>t.t-o.t);const i=[];let a=0;for(const{touch:t}of r){while(a<u.length&&u[a].t<=t.t)i.push({t:u[a].t,route:u[a++]});i.push({t:t.t,touch:t})}while(a<u.length)i.push({t:u[a].t,route:u[a++]});const c=[];let n=null;let d=null;const p=()=>{if(n&&n.count>1){const t=n.last-n.first;n.step.text=n.count===2?`${n.base} 2 times (${t} ms apart)`:`${n.base} ${n.count} times in ${(t/1e3).toFixed(1)} s`}n=null};for(const t of i){if("route"in t&&t.route){if(t.route.pathname===d)continue;d=t.route.pathname;p();c.push({t:t.t,text:`Went to ${t.route.pathname}`});continue}if(!("touch"in t)||!t.touch)continue;const o=x(t.touch);const f=t.touch.kind==="press"||t.touch.kind==="longPress";if(n&&f&&n.base===o&&t.t-n.last<g){n.count++;n.last=t.t;continue}const l=c[c.length-1];if(!f&&l&&t.touch.kind==="text"&&l.text.endsWith(`"${$(t.touch.target)}"`)&&/^(Typed|Cleared) /.test(l.text)){l.text=o;l.t=t.t;continue}p();const h={t:t.t,text:o};c.push(h);if(f)n={step:h,base:o,count:1,first:t.t,last:t.t}}p();return c}export function formatBugCaseSteps(e){return e.map((s,r)=>`${r+1}. ${s.text}`).join("\n")}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const BUG_CASE_VERSION=1;
|
package/lib/module/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export*from"./ui/index.js";export*from"./stores/index.js";export*from"./sync/keyedArrays.js";export*from"./sync/valueShape.js";export*from"./sync/valuePath.js";export*from"./sync/typedEdit.js";export*from"./sync/wireBudget.js";export*from"./sync/wireForm.js";export*from"./sync/toolSyncAdapter.js";export{startSettingsSync,SettingsSync,PERSONAL_SETTING_KEYS,TEAM_SETTING_KEYS,onSettingsApplied,syncSettingsNow}from"./sync/settingsSync.js";export*from"./tools/defineTool.js";export*from"./sync/toolActionRegistry.js";export*from"./sync/toolUiBridge.js";export*from"./sync/toolScreenHeader.js";export{absoluteFill,displayValue,parseDisplayValue,getSafeAreaInsets,persistentStorage,isUsingPersistentStorage,getStorageBackendType,safeStringify,getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize,parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath,loadOptionalModule,getCachedOptionalModule,setRenderCaptureProvider,getRenderCaptureProvider,registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders,superJsonSerialize,superJsonDeserialize,realNow,getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener,reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS,getDevServerOrigin,Subscribable,subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange,useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./utils/index.js";export*from"./utils/toolModules.js";export{subscribeStorageWrites}from"./utils/storageWrites.js";export{registerBrowserRouter,browserRouter,subscribeBrowserNavigation}from"./utils/browserNavigation.js";export{PREVIEW_ITEM_RENDER_BYTE_LIMIT,createRestoreScope,emptyRestoreResult,failedRestore,skippedRestore,classifyPreviewItem,wontApply,unionKeys}from"./utils/snapshotProviderKit.js";export{entityColor,formatValuePreview,shallowDiffSummary}from"./utils/stateTools.js";export*from"./utils/formatting/index.js";export*from"./utils/time/index.js";export{isPlainObject as isPlainObjectUtil}from"./utils/typeHelpers.js";export*from"./icons/index.js";export*from"./clipboard/index.js";export*from"./logger/index.js";export*from"./settings/index.js";export*from"./storage/index.js";export{useSafeAreaInsets,useFilterManager,usePersistedState,resetPersistedStateCache,useChangeLog,useSubscribedValue,useEventStoreEvents,useDeviceInfo,getDeviceInfo,logDeviceInfo}from"./hooks/index.js";export{JsModal}from"./JsModal";export{night,NIGHT_LABEL_TRACKING}from"./ui/night/nightTheme.js";export{QrCodeView}from"./ui/qr/QrCodeView.js";export{NightSectionLabel,NightFootnote,NightCard,NightSeparator,NightRows,NightSwitch,NightChip,NightButton,NightSegmented,NightBadge}from"./ui/night/primitives.js";export{gameUIColors,buoyColors}from"./ui/gameUI/constants/gameUIColors.js";export{refreshGameUIColors}from"./ui/gameUI/constants/gameUIColors.js";export{macOSColors}from"./ui/gameUI/constants/macOSDesignSystemColors.js";export{dialColors}from"./ui/gameUI/constants/gameUIColors.js";export{EnvironmentIndicator}from"./env/EnvironmentIndicator";export{EnvironmentSelector}from"./env/EnvironmentSelector.js";export{EnvironmentSelectorInline}from"./env/EnvironmentSelectorInline";export{normalizeEnvironment}from"./types/types.js";export{HintsProvider,useHintsDisabled,useHintsContext}from"./context/index.js";export*from"./history/index.js";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,useSignInState,ProBadge,ProUpgradeModal,FreeAccountPrompt,LOGIN_COMMAND,getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy,TIER_LIMITS,useLimit,resolveEffectiveTier}from"./license/index.js";export{getAccountAccess,hasAccountAccess,assertAccountAccess,subscribeAccountAccess,getUseAccountAccess,retryAccountAccess,isProNow}from"./license/licenseModule.js";export{guardToolAdapter}from"./sync/toolActionRegistry.js";export{AccountSetup}from"./license/AccountSetup";export{AccountSetupButton}from"./license/AccountSetupContent.js";
|
|
1
|
+
"use strict";export*from"./ui/index.js";export*from"./stores/index.js";export*from"./bugCase/index.js";export*from"./sync/keyedArrays.js";export*from"./sync/valueShape.js";export*from"./sync/valuePath.js";export*from"./sync/typedEdit.js";export*from"./sync/wireBudget.js";export*from"./sync/wireForm.js";export*from"./sync/toolSyncAdapter.js";export{startSettingsSync,SettingsSync,PERSONAL_SETTING_KEYS,TEAM_SETTING_KEYS,onSettingsApplied,syncSettingsNow}from"./sync/settingsSync.js";export*from"./tools/defineTool.js";export*from"./sync/toolActionRegistry.js";export*from"./sync/toolUiBridge.js";export*from"./sync/toolScreenHeader.js";export{absoluteFill,displayValue,parseDisplayValue,getSafeAreaInsets,persistentStorage,isUsingPersistentStorage,getStorageBackendType,safeStringify,getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize,parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath,loadOptionalModule,getCachedOptionalModule,setRenderCaptureProvider,getRenderCaptureProvider,registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders,superJsonSerialize,superJsonDeserialize,realNow,getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener,reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS,getDevServerOrigin,Subscribable,subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange,useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./utils/index.js";export*from"./utils/toolModules.js";export{subscribeStorageWrites}from"./utils/storageWrites.js";export{registerBrowserRouter,browserRouter,subscribeBrowserNavigation}from"./utils/browserNavigation.js";export{PREVIEW_ITEM_RENDER_BYTE_LIMIT,createRestoreScope,emptyRestoreResult,failedRestore,skippedRestore,classifyPreviewItem,wontApply,unionKeys}from"./utils/snapshotProviderKit.js";export{entityColor,formatValuePreview,shallowDiffSummary}from"./utils/stateTools.js";export*from"./utils/formatting/index.js";export*from"./utils/time/index.js";export{isPlainObject as isPlainObjectUtil}from"./utils/typeHelpers.js";export*from"./icons/index.js";export*from"./clipboard/index.js";export*from"./logger/index.js";export*from"./settings/index.js";export*from"./storage/index.js";export{useSafeAreaInsets,useFilterManager,usePersistedState,resetPersistedStateCache,useChangeLog,useSubscribedValue,useEventStoreEvents,useDeviceInfo,getDeviceInfo,logDeviceInfo}from"./hooks/index.js";export{JsModal}from"./JsModal";export{night,NIGHT_LABEL_TRACKING}from"./ui/night/nightTheme.js";export{QrCodeView}from"./ui/qr/QrCodeView.js";export{NightSectionLabel,NightFootnote,NightCard,NightSeparator,NightRows,NightSwitch,NightChip,NightButton,NightSegmented,NightBadge}from"./ui/night/primitives.js";export{gameUIColors,buoyColors}from"./ui/gameUI/constants/gameUIColors.js";export{refreshGameUIColors}from"./ui/gameUI/constants/gameUIColors.js";export{macOSColors}from"./ui/gameUI/constants/macOSDesignSystemColors.js";export{dialColors}from"./ui/gameUI/constants/gameUIColors.js";export{EnvironmentIndicator}from"./env/EnvironmentIndicator";export{EnvironmentSelector}from"./env/EnvironmentSelector.js";export{EnvironmentSelectorInline}from"./env/EnvironmentSelectorInline";export{normalizeEnvironment}from"./types/types.js";export{HintsProvider,useHintsDisabled,useHintsContext}from"./context/index.js";export*from"./history/index.js";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,useSignInState,ProBadge,ProUpgradeModal,FreeAccountPrompt,LOGIN_COMMAND,getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy,TIER_LIMITS,useLimit,resolveEffectiveTier}from"./license/index.js";export{getAccountAccess,hasAccountAccess,assertAccountAccess,subscribeAccountAccess,getUseAccountAccess,retryAccountAccess,isProNow,getTeamCredential}from"./license/licenseModule.js";export{setBuoyAppId,getBuoyAppId}from"./utils/appIdentity.js";export{guardToolAdapter}from"./sync/toolActionRegistry.js";export{AccountSetup}from"./license/AccountSetup";export{AccountSetupButton}from"./license/AccountSetupContent.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback as R,useEffect as W,useRef as C,useState as x}from"react";import{ActivityIndicator as H,Pressable as l,StyleSheet as I,Text as i,View as n}from"react-native";import{Check as j,ChevronRight as v,Copy as O,RefreshCw as F,X as N}from"../icons/lucide-icons.js";import{copyToClipboard as U}from"../clipboard/index.js";import{monoFont as T}from"../ui/fonts.js";import{night as o}from"../ui/night/nightTheme.js";import{getAccountAccess as E,getUseAccountAccess as B,getUseLicense as V,retryAccountAccess as M}from"./licenseModule.js";import{openPricing as S}from"./openPricing.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";export const LOGIN_COMMAND="npx buoy login";export function AccountSetupButton({onPress:p,expanded:u=false}){const m=B()();const y=m.status==="initializing";return r(l,{accessibilityRole:"button",accessibilityLabel:"Sign in to Buoy",accessibilityState:{expanded:u},onPress:p,style:({pressed:b})=>[e.launcher,u&&e.launcherOpen,b&&e.pressed],children:[t(n,{style:e.brandDot}),t(i,{style:e.launcherBrand,children:"BUOY"}),t(n,{style:e.launcherDivider}),t(i,{style:e.launcherLabel,children:y?"Checking\u2026":"Sign in"}),y?t(H,{size:14,color:o.color.accent}):t(v,{size:14,color:o.color.textSecondary})]})}export function AccountSetupCard({onClose:p,titleId:u}){const m=B()();const y=V();const b=y?.();const[g,k]=x(false);const[L,w]=x(false);const[A,d]=x(null);const h=C(null);const a=C(true);const f=C(false);const s=L||m.status==="initializing";const z=b?.error||A;W(()=>{a.current=true;return()=>{a.current=false;if(h.current)clearTimeout(h.current)}},[]);const D=R(async()=>{const c=await U(LOGIN_COMMAND);if(!a.current)return;if(!c){d("Select the command to copy it, then run it in your project terminal.");return}d(null);k(true);if(h.current)clearTimeout(h.current);h.current=setTimeout(()=>k(false),2e3)},[]);const P=R(async()=>{if(f.current)return;f.current=true;w(true);d(null);try{await M();if(a.current&&E().status!=="admitted"){d("No account connected yet. Run the command, sign in, then reload your app.")}}catch{if(a.current)d("Couldn't verify your account. Check your connection and try again.")}finally{f.current=false;if(a.current)w(false)}},[]);return r(n,{style:e.card,children:[r(n,{style:e.header,children:[r(n,{style:e.brand,children:[t(n,{style:e.brandDot}),t(i,{style:e.wordmark,children:"BUOY"}),t(i,{style:e.headerLabel,children:"Developer tools"})]}),t(l,{accessibilityRole:"button",accessibilityLabel:"Close account setup",onPress:p,hitSlop:6,style:({pressed:c})=>[e.close,c&&e.pressed],children:t(N,{size:16,color:o.color.textSecondary})})]}),r(i,{nativeID:u,accessibilityRole:"header",style:e.title,children:["Connect your","\n","Buoy account"]}),t(i,{style:e.description,children:"Sign in with a Free or Pro account to open your developer tools."}),r(n,{style:e.terminal,children:[r(n,{style:e.terminalHeader,children:[t(i,{style:e.terminalLabel,children:"RUN IN YOUR PROJECT"}),r(l,{accessibilityRole:"button",accessibilityLabel:g?"Login command copied":"Copy login command",onPress:D,style:({pressed:c})=>[e.copy,c&&e.pressed],children:[g?t(j,{size:13,color:o.color.accent}):t(O,{size:13,color:o.color.textSecondary}),t(i,{accessibilityLiveRegion:"polite",style:[e.copyText,g&&e.accentText],children:g?"Copied":"Copy"})]})]}),r(n,{style:e.command,children:[t(i,{accessibilityElementsHidden:true,importantForAccessibility:"no",style:e.prompt,children:"$"}),t(i,{selectable:true,style:e.commandText,children:LOGIN_COMMAND})]})]}),t(i,{style:e.hint,children:"Finish signing in, then reload your app."}),r(l,{accessibilityRole:"button",accessibilityState:{disabled:s,busy:s},disabled:s,onPress:P,style:({pressed:c})=>[e.primary,c&&e.primaryPressed,s&&e.primaryBusy],children:[s?t(H,{size:15,color:o.color.onAccent}):t(F,{size:15,color:o.color.onAccent}),t(i,{style:e.primaryText,children:s?"Checking connection\u2026":"Check connection"})]}),z&&t(i,{accessibilityRole:"alert",accessibilityLiveRegion:"polite",style:e.feedback,children:z}),r(n,{style:e.footer,children:[t(i,{style:e.footerLabel,children:"Need a hand?"}),r(n,{style:e.links,children:[t(l,{accessibilityRole:"link",onPress:()=>S("https://github.com/Buoy-gg/buoy/issues/new/choose"),style:e.link,children:t(i,{style:e.linkText,children:"GitHub"})}),t(l,{accessibilityRole:"link",accessibilityLabel:"Email support@buoy.gg",onPress:()=>S("mailto:support@buoy.gg"),style:e.link,children:t(i,{style:e.linkText,children:"Email"})}),t(l,{accessibilityRole:"link",accessibilityLabel:"View Buoy plans",onPress:()=>S(),style:e.link,children:t(i,{style:e.linkText,children:"Plans"})})]})]})]})}const e=I.create({launcher:{flexDirection:"row",alignItems:"center",gap:10,minHeight:44,paddingHorizontal:16,borderRadius:14,backgroundColor:"#111315",borderWidth:1,borderColor:"#303437",shadowColor:"#000",shadowOpacity:.28,shadowRadius:14,shadowOffset:{width:0,height:4},elevation:8},launcherOpen:{borderColor:o.color.accentBorderStrong},launcherBrand:{color:o.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.2,lineHeight:16},launcherDivider:{width:1,height:16,backgroundColor:"#35383C",marginHorizontal:2},launcherLabel:{color:o.color.text,fontSize:12,fontWeight:"500",lineHeight:18},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:o.color.accent},card:{width:"100%",backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:12},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:24},brand:{flexDirection:"row",alignItems:"center",gap:8},wordmark:{color:o.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},headerLabel:{color:o.color.textSecondary,fontSize:11,lineHeight:16,marginLeft:4},close:{width:28,height:28,borderRadius:8,backgroundColor:o.color.fill,alignItems:"center",justifyContent:"center"},title:{color:o.color.text,fontSize:25,fontWeight:"600",lineHeight:31,letterSpacing:-.6,marginBottom:10},description:{color:"#A4AAAF",fontSize:13,lineHeight:20,marginBottom:22},terminal:{backgroundColor:"#090B0D",borderWidth:1,borderColor:"#292C30",borderRadius:12},terminalHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:14,paddingRight:6,paddingTop:6},terminalLabel:{color:"#93999F",fontSize:9,fontWeight:"600",letterSpacing:.8,lineHeight:14},copy:{minWidth:68,minHeight:32,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:5,borderRadius:6},copyText:{color:o.color.textSecondary,fontSize:11,fontWeight:"500",lineHeight:16},accentText:{color:o.color.accent},command:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:16,paddingTop:6,paddingBottom:18},prompt:{color:o.color.accent,fontSize:15,fontFamily:T,lineHeight:22},commandText:{color:o.color.text,fontSize:15,fontFamily:T,lineHeight:22,flexShrink:1},hint:{color:o.color.textSecondary,fontSize:12,lineHeight:18,marginTop:10,marginBottom:22},primary:{minHeight:42,borderRadius:10,backgroundColor:o.color.accent,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:9,paddingHorizontal:12,paddingVertical:10},primaryPressed:{backgroundColor:o.color.accentPressed},primaryBusy:{opacity:.75},primaryText:{color:o.color.onAccent,fontSize:13,fontWeight:"600",lineHeight:20},feedback:{color:"#B5BBC0",fontSize:12,lineHeight:18,marginTop:12},footer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",borderTopWidth:1,borderTopColor:o.color.separator,marginTop:20,paddingTop:8},footerLabel:{color:o.color.textSecondary,fontSize:11,lineHeight:16},links:{flexDirection:"row",gap:2},link:{paddingHorizontal:7,paddingVertical:10,borderRadius:6},linkText:{color:"#B5BBC0",fontSize:11,fontWeight:"500",lineHeight:16},pressed:{opacity:.7}});
|
|
1
|
+
"use strict";import{useCallback as R,useEffect as W,useRef as C,useState as x}from"react";import{ActivityIndicator as H,Pressable as l,StyleSheet as I,Text as i,View as n}from"react-native";import{Check as j,ChevronRight as v,Copy as O,RefreshCw as F,X as N}from"../icons/lucide-icons.js";import{copyToClipboard as U}from"../clipboard/index.js";import{monoFont as T}from"../ui/fonts.js";import{night as o}from"../ui/night/nightTheme.js";import{getAccountAccess as E,getUseAccountAccess as B,getUseLicense as V,retryAccountAccess as M}from"./licenseModule.js";import{openPricing as S}from"./openPricing.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";export const LOGIN_COMMAND="npx --package=@buoy-gg/core buoy login";export function AccountSetupButton({onPress:p,expanded:u=false}){const m=B()();const y=m.status==="initializing";return r(l,{accessibilityRole:"button",accessibilityLabel:"Sign in to Buoy",accessibilityState:{expanded:u},onPress:p,style:({pressed:b})=>[e.launcher,u&&e.launcherOpen,b&&e.pressed],children:[t(n,{style:e.brandDot}),t(i,{style:e.launcherBrand,children:"BUOY"}),t(n,{style:e.launcherDivider}),t(i,{style:e.launcherLabel,children:y?"Checking\u2026":"Sign in"}),y?t(H,{size:14,color:o.color.accent}):t(v,{size:14,color:o.color.textSecondary})]})}export function AccountSetupCard({onClose:p,titleId:u}){const m=B()();const y=V();const b=y?.();const[g,k]=x(false);const[L,w]=x(false);const[A,d]=x(null);const h=C(null);const a=C(true);const f=C(false);const s=L||m.status==="initializing";const z=b?.error||A;W(()=>{a.current=true;return()=>{a.current=false;if(h.current)clearTimeout(h.current)}},[]);const D=R(async()=>{const c=await U(LOGIN_COMMAND);if(!a.current)return;if(!c){d("Select the command to copy it, then run it in your project terminal.");return}d(null);k(true);if(h.current)clearTimeout(h.current);h.current=setTimeout(()=>k(false),2e3)},[]);const P=R(async()=>{if(f.current)return;f.current=true;w(true);d(null);try{await M();if(a.current&&E().status!=="admitted"){d("No account connected yet. Run the command, sign in, then reload your app.")}}catch{if(a.current)d("Couldn't verify your account. Check your connection and try again.")}finally{f.current=false;if(a.current)w(false)}},[]);return r(n,{style:e.card,children:[r(n,{style:e.header,children:[r(n,{style:e.brand,children:[t(n,{style:e.brandDot}),t(i,{style:e.wordmark,children:"BUOY"}),t(i,{style:e.headerLabel,children:"Developer tools"})]}),t(l,{accessibilityRole:"button",accessibilityLabel:"Close account setup",onPress:p,hitSlop:6,style:({pressed:c})=>[e.close,c&&e.pressed],children:t(N,{size:16,color:o.color.textSecondary})})]}),r(i,{nativeID:u,accessibilityRole:"header",style:e.title,children:["Connect your","\n","Buoy account"]}),t(i,{style:e.description,children:"Sign in with a Free or Pro account to open your developer tools."}),r(n,{style:e.terminal,children:[r(n,{style:e.terminalHeader,children:[t(i,{style:e.terminalLabel,children:"RUN IN YOUR PROJECT"}),r(l,{accessibilityRole:"button",accessibilityLabel:g?"Login command copied":"Copy login command",onPress:D,style:({pressed:c})=>[e.copy,c&&e.pressed],children:[g?t(j,{size:13,color:o.color.accent}):t(O,{size:13,color:o.color.textSecondary}),t(i,{accessibilityLiveRegion:"polite",style:[e.copyText,g&&e.accentText],children:g?"Copied":"Copy"})]})]}),r(n,{style:e.command,children:[t(i,{accessibilityElementsHidden:true,importantForAccessibility:"no",style:e.prompt,children:"$"}),t(i,{selectable:true,style:e.commandText,children:LOGIN_COMMAND})]})]}),t(i,{style:e.hint,children:"Finish signing in, then reload your app."}),r(l,{accessibilityRole:"button",accessibilityState:{disabled:s,busy:s},disabled:s,onPress:P,style:({pressed:c})=>[e.primary,c&&e.primaryPressed,s&&e.primaryBusy],children:[s?t(H,{size:15,color:o.color.onAccent}):t(F,{size:15,color:o.color.onAccent}),t(i,{style:e.primaryText,children:s?"Checking connection\u2026":"Check connection"})]}),z&&t(i,{accessibilityRole:"alert",accessibilityLiveRegion:"polite",style:e.feedback,children:z}),r(n,{style:e.footer,children:[t(i,{style:e.footerLabel,children:"Need a hand?"}),r(n,{style:e.links,children:[t(l,{accessibilityRole:"link",onPress:()=>S("https://github.com/Buoy-gg/buoy/issues/new/choose"),style:e.link,children:t(i,{style:e.linkText,children:"GitHub"})}),t(l,{accessibilityRole:"link",accessibilityLabel:"Email support@buoy.gg",onPress:()=>S("mailto:support@buoy.gg"),style:e.link,children:t(i,{style:e.linkText,children:"Email"})}),t(l,{accessibilityRole:"link",accessibilityLabel:"View Buoy plans",onPress:()=>S(),style:e.link,children:t(i,{style:e.linkText,children:"Plans"})})]})]})]})}const e=I.create({launcher:{flexDirection:"row",alignItems:"center",gap:10,minHeight:44,paddingHorizontal:16,borderRadius:14,backgroundColor:"#111315",borderWidth:1,borderColor:"#303437",shadowColor:"#000",shadowOpacity:.28,shadowRadius:14,shadowOffset:{width:0,height:4},elevation:8},launcherOpen:{borderColor:o.color.accentBorderStrong},launcherBrand:{color:o.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.2,lineHeight:16},launcherDivider:{width:1,height:16,backgroundColor:"#35383C",marginHorizontal:2},launcherLabel:{color:o.color.text,fontSize:12,fontWeight:"500",lineHeight:18},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:o.color.accent},card:{width:"100%",backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:12},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:24},brand:{flexDirection:"row",alignItems:"center",gap:8},wordmark:{color:o.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},headerLabel:{color:o.color.textSecondary,fontSize:11,lineHeight:16,marginLeft:4},close:{width:28,height:28,borderRadius:8,backgroundColor:o.color.fill,alignItems:"center",justifyContent:"center"},title:{color:o.color.text,fontSize:25,fontWeight:"600",lineHeight:31,letterSpacing:-.6,marginBottom:10},description:{color:"#A4AAAF",fontSize:13,lineHeight:20,marginBottom:22},terminal:{backgroundColor:"#090B0D",borderWidth:1,borderColor:"#292C30",borderRadius:12},terminalHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:14,paddingRight:6,paddingTop:6},terminalLabel:{color:"#93999F",fontSize:9,fontWeight:"600",letterSpacing:.8,lineHeight:14},copy:{minWidth:68,minHeight:32,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:5,borderRadius:6},copyText:{color:o.color.textSecondary,fontSize:11,fontWeight:"500",lineHeight:16},accentText:{color:o.color.accent},command:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:16,paddingTop:6,paddingBottom:18},prompt:{color:o.color.accent,fontSize:15,fontFamily:T,lineHeight:22},commandText:{color:o.color.text,fontSize:15,fontFamily:T,lineHeight:22,flexShrink:1},hint:{color:o.color.textSecondary,fontSize:12,lineHeight:18,marginTop:10,marginBottom:22},primary:{minHeight:42,borderRadius:10,backgroundColor:o.color.accent,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:9,paddingHorizontal:12,paddingVertical:10},primaryPressed:{backgroundColor:o.color.accentPressed},primaryBusy:{opacity:.75},primaryText:{color:o.color.onAccent,fontSize:13,fontWeight:"600",lineHeight:20},feedback:{color:"#B5BBC0",fontSize:12,lineHeight:18,marginTop:12},footer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",borderTopWidth:1,borderTopColor:o.color.separator,marginTop:20,paddingTop:8},footerLabel:{color:o.color.textSecondary,fontSize:11,lineHeight:16},links:{flexDirection:"row",gap:2},link:{paddingHorizontal:7,paddingVertical:10,borderRadius:6},linkText:{color:"#B5BBC0",fontSize:11,fontWeight:"500",lineHeight:16},pressed:{opacity:.7}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import*as t from"@buoy-gg/license";import{canInitializeAccount as l}from"./accountRuntime";let
|
|
1
|
+
"use strict";import*as t from"@buoy-gg/license";import{canInitializeAccount as l}from"./accountRuntime";let o=null;let s=null;let i=null;let a=false;function n(){if(a)return;a=true;try{const e=t;if(e){o=e.useIsPro??null;s=e.useLicense??null;i=e.useTier??null}}catch{}}export function getUseIsPro(){n();return o??(()=>false)}export function getUseLicense(){n();return s}export function getUseTier(){n();return i??(()=>"free")}export function isProNow(){try{return t.isPro?.()??false}catch{return false}}const r={status:"locked",reason:"account_required",validUntil:null};function c(){if(!l())return null;try{const e=t.LicenseManager;void e?.initialize?.();return e}catch{return null}}export function getAccountAccess(){return c()?.getAccountAccess?.()??r}export function hasAccountAccess(){return getAccountAccess().status==="admitted"}export function assertAccountAccess(){if(!hasAccountAccess())throw new Error("A verified Buoy account is required. Run npx --package=@buoy-gg/core buoy login, then reload your app.")}export function subscribeAccountAccess(e){return c()?.subscribe?.(e)??(()=>{})}export function getUseAccountAccess(){try{return t.useAccountAccess??(()=>r)}catch{return()=>r}}export async function retryAccountAccess(){const e=c();const u=e?.getState?.().licenseKey;if(u)await e.setLicenseKey(u,{force:true});else await e?.initialize?.()}export function getSignInSession(){try{return t.SessionManager}catch{return void 0}}export async function signOutOfBuoy(){try{await t.SessionManager?.signOut()}catch{}}export function getSyncCredential(){try{return t.getSyncCredential?.()??null}catch{return null}}export function getTeamCredential(){try{return t.getTeamCredential?.()??null}catch{return null}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const devToolsStorageKeys={base:"@react_buoy",bubble:{root:()=>`${devToolsStorageKeys.base}_bubble`,settings:()=>`${devToolsStorageKeys.bubble.root()}_settings`,userPreferences:()=>`${devToolsStorageKeys.bubble.root()}_user_preferences`,position:()=>`${devToolsStorageKeys.bubble.root()}_position`},modal:{root:()=>`${devToolsStorageKeys.base}_modal`,state:()=>`${devToolsStorageKeys.modal.root()}_state`,position:()=>`${devToolsStorageKeys.modal.root()}_position`,dimensions:()=>`${devToolsStorageKeys.modal.root()}_dimensions`,hintAcknowledged:()=>`${devToolsStorageKeys.modal.root()}_hint_acknowledged`},custom:e=>{const o=`${devToolsStorageKeys.base}_custom_${e}`;return{root:()=>o,modal:()=>`${o}_modal`,settings:()=>`${o}_settings`,key:t=>`${o}_${t}`}},askBuoy:{root:()=>`${devToolsStorageKeys.base}_ask_buoy`,model:()=>`${devToolsStorageKeys.askBuoy.root()}_model`},settings:{root:()=>`${devToolsStorageKeys.base}_settings`,theme:()=>`${devToolsStorageKeys.settings.root()}_theme`,preferences:()=>`${devToolsStorageKeys.settings.root()}_preferences`,wifiEnabled:()=>`${devToolsStorageKeys.settings.root()}_wifi_enabled`,global:()=>`${devToolsStorageKeys.settings.root()}_global`,activeTab:()=>`${devToolsStorageKeys.settings.root()}_active_tab`,modalOpen:()=>`${devToolsStorageKeys.settings.root()}_modal_open`},dial:{root:()=>`${devToolsStorageKeys.base}_dial`,isOpen:()=>`${devToolsStorageKeys.dial.root()}_is_open`,usage:()=>`${devToolsStorageKeys.dial.root()}_usage`},clipboard:{root:()=>`${devToolsStorageKeys.base}_clipboard`,hintAcknowledged:()=>`${devToolsStorageKeys.clipboard.root()}_hint_acknowledged`},env:{root:()=>`${devToolsStorageKeys.base}_env`,modal:()=>`${devToolsStorageKeys.env.root()}_modal`,currentEnv:()=>`${devToolsStorageKeys.env.root()}_current`,overrides:()=>`${devToolsStorageKeys.env.root()}_overrides`},sentry:{root:()=>`${devToolsStorageKeys.base}_sentry`,modal:()=>`${devToolsStorageKeys.sentry.root()}_modal`,filters:()=>`${devToolsStorageKeys.sentry.root()}_filters`,preferences:()=>`${devToolsStorageKeys.sentry.root()}_preferences`},storage:{root:()=>`${devToolsStorageKeys.base}_storage`,modal:()=>`${devToolsStorageKeys.storage.root()}_modal`,eventsModal:()=>`${devToolsStorageKeys.storage.root()}_events_modal`,filters:()=>`${devToolsStorageKeys.storage.root()}_filters`,eventFilters:()=>`${devToolsStorageKeys.storage.root()}_event_filters`,keyFilters:()=>`${devToolsStorageKeys.storage.root()}_key_filters`,pinnedKeys:()=>`${devToolsStorageKeys.storage.root()}_pinned_keys`,preferences:()=>`${devToolsStorageKeys.storage.root()}_preferences`,activeTab:()=>`${devToolsStorageKeys.storage.root()}_active_tab`,isMonitoring:()=>`${devToolsStorageKeys.storage.root()}_is_monitoring`,diffViewerMode:()=>`${devToolsStorageKeys.storage.root()}_diff_viewer_mode`},clock:{root:()=>`${devToolsStorageKeys.base}_clock`,state:()=>`${devToolsStorageKeys.clock.root()}_state`},permissions:{root:()=>`${devToolsStorageKeys.base}_permissions`,state:()=>`${devToolsStorageKeys.permissions.root()}_state`},lifecycle:{root:()=>`${devToolsStorageKeys.base}_lifecycle`,state:()=>`${devToolsStorageKeys.lifecycle.root()}_state`},location:{root:()=>`${devToolsStorageKeys.base}_location`,state:()=>`${devToolsStorageKeys.location.root()}_state`},timeMachine:{root:()=>`${devToolsStorageKeys.base}_time_machine`,diffViewerMode:()=>`${devToolsStorageKeys.timeMachine.root()}_diff_viewer_mode`,armedPoint:()=>`${devToolsStorageKeys.timeMachine.root()}_armed_point`,barReloadMode:()=>`${devToolsStorageKeys.timeMachine.root()}_bar_reload_mode`,disabledSources:()=>`${devToolsStorageKeys.timeMachine.root()}_disabled_sources`},scenarios:{root:()=>`${devToolsStorageKeys.base}_scenarios`,modal:()=>`${devToolsStorageKeys.scenarios.root()}_modal`,library:()=>`${devToolsStorageKeys.scenarios.root()}_library`,active:()=>`${devToolsStorageKeys.scenarios.root()}_active`},reactQuery:{root:()=>`${devToolsStorageKeys.base}_rq`,modal:()=>`${devToolsStorageKeys.reactQuery.root()}_modal`,browserModal:()=>`${devToolsStorageKeys.reactQuery.root()}_browser_modal`,mutationModal:()=>`${devToolsStorageKeys.reactQuery.root()}_mutation_modal`,filters:()=>`${devToolsStorageKeys.reactQuery.root()}_filters`,ignoredPatterns:()=>`${devToolsStorageKeys.reactQuery.root()}_ignored_patterns`,includedPatterns:()=>`${devToolsStorageKeys.reactQuery.root()}_included_patterns`,preferences:()=>`${devToolsStorageKeys.reactQuery.root()}_preferences`},network:{root:()=>`${devToolsStorageKeys.base}_network`,modal:()=>`${devToolsStorageKeys.network.root()}_modal`,copyModal:()=>`${devToolsStorageKeys.network.root()}_copy_modal`,filters:()=>`${devToolsStorageKeys.network.root()}_filters`,ignoredDomains:()=>`${devToolsStorageKeys.network.root()}_ignored_domains`,ignoredUrls:()=>`${devToolsStorageKeys.network.root()}_ignored_urls`,preferences:()=>`${devToolsStorageKeys.network.root()}_preferences`,copyOptions:()=>`${devToolsStorageKeys.network.root()}_copy_options`,saved:()=>`${devToolsStorageKeys.network.root()}_saved`,overrides:()=>`${devToolsStorageKeys.network.root()}_overrides`},routeEvents:{root:()=>`${devToolsStorageKeys.base}_route_events`,modal:()=>`${devToolsStorageKeys.routeEvents.root()}_modal`,eventFilters:()=>`${devToolsStorageKeys.routeEvents.root()}_event_filters`,activeTab:()=>`${devToolsStorageKeys.routeEvents.root()}_active_tab`,isMonitoring:()=>`${devToolsStorageKeys.routeEvents.root()}_is_monitoring`,detailView:()=>`${devToolsStorageKeys.routeEvents.root()}_detail_view`,diffViewerMode:()=>`${devToolsStorageKeys.routeEvents.root()}_diff_viewer_mode`},highlightUpdates:{root:()=>`${devToolsStorageKeys.base}_highlight_updates`,modal:()=>`${devToolsStorageKeys.highlightUpdates.root()}_modal`,isTracking:()=>`${devToolsStorageKeys.highlightUpdates.root()}_is_tracking`,filters:()=>`${devToolsStorageKeys.highlightUpdates.root()}_filters`,settings:()=>`${devToolsStorageKeys.highlightUpdates.root()}_settings`,copySettings:()=>`${devToolsStorageKeys.highlightUpdates.root()}_copy_settings`},benchmark:{root:()=>`${devToolsStorageKeys.base}_benchmark`,modal:()=>`${devToolsStorageKeys.benchmark.root()}_modal`,isRecording:()=>`${devToolsStorageKeys.benchmark.root()}_is_recording`,activeTab:()=>`${devToolsStorageKeys.benchmark.root()}_active_tab`,settings:()=>`${devToolsStorageKeys.benchmark.root()}_settings`,selectedReports:()=>`${devToolsStorageKeys.benchmark.root()}_selected_reports`},debugBorders:{root:()=>`${devToolsStorageKeys.base}_debug_borders`,infoModal:()=>`${devToolsStorageKeys.debugBorders.root()}_info_modal`},events:{root:()=>`${devToolsStorageKeys.base}_events`,modal:()=>`${devToolsStorageKeys.events.root()}_modal`,enabledSources:()=>`${devToolsStorageKeys.events.root()}_enabled_sources`,isCapturing:()=>`${devToolsStorageKeys.events.root()}_is_capturing`,pausedAt:()=>`${devToolsStorageKeys.events.root()}_paused_at`,copySettings:()=>`${devToolsStorageKeys.events.root()}_copy_settings`},sync:{root:()=>`${devToolsStorageKeys.base}_sync`,deviceId:()=>`${devToolsStorageKeys.sync.root()}_device_id`}};const r=["@devtools","@dev_tools_","@modal_state_","@react_query_browser_modal","@react_query_modal","@react_query_mutation_modal","@sentry_logs_modal","@floating_rn_better_dev_tools_","@floating_tools_","@apphost_","@bubble_settings_","@env_vars_modal","@storage_modal","@floating_@devtools_","dev_last_route"];export function isDevToolsStorageKey(e){if(!e)return false;for(const o of["@AsyncStorage:","CapacitorStorage."]){if(e.startsWith(o))e=e.slice(o.length)}if(e.startsWith(devToolsStorageKeys.base)){return true}if(e.startsWith("buoy-")){return true}if(e.startsWith("@buoy")){return true}if(/^(?:buoy[._]|__buoy|react-buoy)/i.test(e)){return true}for(const o of r){if(e.startsWith(o)){return true}}return false}export function filterOutDevToolsKeys(e){return e.filter(o=>!isDevToolsStorageKey(o))}export function getAllDevToolsStorageKeys(){const e=[];e.push(devToolsStorageKeys.bubble.settings());e.push(devToolsStorageKeys.bubble.userPreferences());e.push(devToolsStorageKeys.bubble.position());e.push(devToolsStorageKeys.modal.state());e.push(devToolsStorageKeys.modal.position());e.push(devToolsStorageKeys.modal.dimensions());e.push(devToolsStorageKeys.settings.theme());e.push(devToolsStorageKeys.settings.preferences());e.push(devToolsStorageKeys.env.currentEnv());e.push(devToolsStorageKeys.env.overrides());e.push(devToolsStorageKeys.sentry.filters());e.push(devToolsStorageKeys.sentry.preferences());e.push(devToolsStorageKeys.storage.filters());e.push(devToolsStorageKeys.storage.preferences());e.push(devToolsStorageKeys.reactQuery.filters());e.push(devToolsStorageKeys.reactQuery.preferences());return e}
|
|
1
|
+
"use strict";export const devToolsStorageKeys={base:"@react_buoy",bubble:{root:()=>`${devToolsStorageKeys.base}_bubble`,settings:()=>`${devToolsStorageKeys.bubble.root()}_settings`,userPreferences:()=>`${devToolsStorageKeys.bubble.root()}_user_preferences`,position:()=>`${devToolsStorageKeys.bubble.root()}_position`},modal:{root:()=>`${devToolsStorageKeys.base}_modal`,state:()=>`${devToolsStorageKeys.modal.root()}_state`,position:()=>`${devToolsStorageKeys.modal.root()}_position`,dimensions:()=>`${devToolsStorageKeys.modal.root()}_dimensions`,hintAcknowledged:()=>`${devToolsStorageKeys.modal.root()}_hint_acknowledged`},custom:e=>{const o=`${devToolsStorageKeys.base}_custom_${e}`;return{root:()=>o,modal:()=>`${o}_modal`,settings:()=>`${o}_settings`,key:t=>`${o}_${t}`}},askBuoy:{root:()=>`${devToolsStorageKeys.base}_ask_buoy`,model:()=>`${devToolsStorageKeys.askBuoy.root()}_model`},settings:{root:()=>`${devToolsStorageKeys.base}_settings`,theme:()=>`${devToolsStorageKeys.settings.root()}_theme`,preferences:()=>`${devToolsStorageKeys.settings.root()}_preferences`,wifiEnabled:()=>`${devToolsStorageKeys.settings.root()}_wifi_enabled`,global:()=>`${devToolsStorageKeys.settings.root()}_global`,activeTab:()=>`${devToolsStorageKeys.settings.root()}_active_tab`,modalOpen:()=>`${devToolsStorageKeys.settings.root()}_modal_open`},dial:{root:()=>`${devToolsStorageKeys.base}_dial`,isOpen:()=>`${devToolsStorageKeys.dial.root()}_is_open`,usage:()=>`${devToolsStorageKeys.dial.root()}_usage`},clipboard:{root:()=>`${devToolsStorageKeys.base}_clipboard`,hintAcknowledged:()=>`${devToolsStorageKeys.clipboard.root()}_hint_acknowledged`},env:{root:()=>`${devToolsStorageKeys.base}_env`,modal:()=>`${devToolsStorageKeys.env.root()}_modal`,currentEnv:()=>`${devToolsStorageKeys.env.root()}_current`,overrides:()=>`${devToolsStorageKeys.env.root()}_overrides`},sentry:{root:()=>`${devToolsStorageKeys.base}_sentry`,modal:()=>`${devToolsStorageKeys.sentry.root()}_modal`,filters:()=>`${devToolsStorageKeys.sentry.root()}_filters`,preferences:()=>`${devToolsStorageKeys.sentry.root()}_preferences`},storage:{root:()=>`${devToolsStorageKeys.base}_storage`,modal:()=>`${devToolsStorageKeys.storage.root()}_modal`,eventsModal:()=>`${devToolsStorageKeys.storage.root()}_events_modal`,filters:()=>`${devToolsStorageKeys.storage.root()}_filters`,eventFilters:()=>`${devToolsStorageKeys.storage.root()}_event_filters`,keyFilters:()=>`${devToolsStorageKeys.storage.root()}_key_filters`,pinnedKeys:()=>`${devToolsStorageKeys.storage.root()}_pinned_keys`,preferences:()=>`${devToolsStorageKeys.storage.root()}_preferences`,activeTab:()=>`${devToolsStorageKeys.storage.root()}_active_tab`,isMonitoring:()=>`${devToolsStorageKeys.storage.root()}_is_monitoring`,diffViewerMode:()=>`${devToolsStorageKeys.storage.root()}_diff_viewer_mode`},clock:{root:()=>`${devToolsStorageKeys.base}_clock`,state:()=>`${devToolsStorageKeys.clock.root()}_state`},bugLinks:{root:()=>`${devToolsStorageKeys.base}_bug_links`,links:()=>`${devToolsStorageKeys.bugLinks.root()}_links`,settings:()=>`${devToolsStorageKeys.bugLinks.root()}_settings`,loaded:()=>`${devToolsStorageKeys.bugLinks.root()}_loaded`},permissions:{root:()=>`${devToolsStorageKeys.base}_permissions`,state:()=>`${devToolsStorageKeys.permissions.root()}_state`},lifecycle:{root:()=>`${devToolsStorageKeys.base}_lifecycle`,state:()=>`${devToolsStorageKeys.lifecycle.root()}_state`},location:{root:()=>`${devToolsStorageKeys.base}_location`,state:()=>`${devToolsStorageKeys.location.root()}_state`},timeMachine:{root:()=>`${devToolsStorageKeys.base}_time_machine`,diffViewerMode:()=>`${devToolsStorageKeys.timeMachine.root()}_diff_viewer_mode`,armedPoint:()=>`${devToolsStorageKeys.timeMachine.root()}_armed_point`,barReloadMode:()=>`${devToolsStorageKeys.timeMachine.root()}_bar_reload_mode`,disabledSources:()=>`${devToolsStorageKeys.timeMachine.root()}_disabled_sources`},scenarios:{root:()=>`${devToolsStorageKeys.base}_scenarios`,modal:()=>`${devToolsStorageKeys.scenarios.root()}_modal`,library:()=>`${devToolsStorageKeys.scenarios.root()}_library`,active:()=>`${devToolsStorageKeys.scenarios.root()}_active`,team:()=>`${devToolsStorageKeys.scenarios.root()}_team`},reactQuery:{root:()=>`${devToolsStorageKeys.base}_rq`,modal:()=>`${devToolsStorageKeys.reactQuery.root()}_modal`,browserModal:()=>`${devToolsStorageKeys.reactQuery.root()}_browser_modal`,mutationModal:()=>`${devToolsStorageKeys.reactQuery.root()}_mutation_modal`,filters:()=>`${devToolsStorageKeys.reactQuery.root()}_filters`,ignoredPatterns:()=>`${devToolsStorageKeys.reactQuery.root()}_ignored_patterns`,includedPatterns:()=>`${devToolsStorageKeys.reactQuery.root()}_included_patterns`,preferences:()=>`${devToolsStorageKeys.reactQuery.root()}_preferences`},network:{root:()=>`${devToolsStorageKeys.base}_network`,modal:()=>`${devToolsStorageKeys.network.root()}_modal`,copyModal:()=>`${devToolsStorageKeys.network.root()}_copy_modal`,filters:()=>`${devToolsStorageKeys.network.root()}_filters`,ignoredDomains:()=>`${devToolsStorageKeys.network.root()}_ignored_domains`,ignoredUrls:()=>`${devToolsStorageKeys.network.root()}_ignored_urls`,preferences:()=>`${devToolsStorageKeys.network.root()}_preferences`,copyOptions:()=>`${devToolsStorageKeys.network.root()}_copy_options`,saved:()=>`${devToolsStorageKeys.network.root()}_saved`,overrides:()=>`${devToolsStorageKeys.network.root()}_overrides`},routeEvents:{root:()=>`${devToolsStorageKeys.base}_route_events`,modal:()=>`${devToolsStorageKeys.routeEvents.root()}_modal`,eventFilters:()=>`${devToolsStorageKeys.routeEvents.root()}_event_filters`,activeTab:()=>`${devToolsStorageKeys.routeEvents.root()}_active_tab`,isMonitoring:()=>`${devToolsStorageKeys.routeEvents.root()}_is_monitoring`,detailView:()=>`${devToolsStorageKeys.routeEvents.root()}_detail_view`,diffViewerMode:()=>`${devToolsStorageKeys.routeEvents.root()}_diff_viewer_mode`},highlightUpdates:{root:()=>`${devToolsStorageKeys.base}_highlight_updates`,modal:()=>`${devToolsStorageKeys.highlightUpdates.root()}_modal`,isTracking:()=>`${devToolsStorageKeys.highlightUpdates.root()}_is_tracking`,filters:()=>`${devToolsStorageKeys.highlightUpdates.root()}_filters`,settings:()=>`${devToolsStorageKeys.highlightUpdates.root()}_settings`,copySettings:()=>`${devToolsStorageKeys.highlightUpdates.root()}_copy_settings`},benchmark:{root:()=>`${devToolsStorageKeys.base}_benchmark`,modal:()=>`${devToolsStorageKeys.benchmark.root()}_modal`,isRecording:()=>`${devToolsStorageKeys.benchmark.root()}_is_recording`,activeTab:()=>`${devToolsStorageKeys.benchmark.root()}_active_tab`,settings:()=>`${devToolsStorageKeys.benchmark.root()}_settings`,selectedReports:()=>`${devToolsStorageKeys.benchmark.root()}_selected_reports`},debugBorders:{root:()=>`${devToolsStorageKeys.base}_debug_borders`,infoModal:()=>`${devToolsStorageKeys.debugBorders.root()}_info_modal`},events:{root:()=>`${devToolsStorageKeys.base}_events`,modal:()=>`${devToolsStorageKeys.events.root()}_modal`,enabledSources:()=>`${devToolsStorageKeys.events.root()}_enabled_sources`,isCapturing:()=>`${devToolsStorageKeys.events.root()}_is_capturing`,pausedAt:()=>`${devToolsStorageKeys.events.root()}_paused_at`,copySettings:()=>`${devToolsStorageKeys.events.root()}_copy_settings`},sync:{root:()=>`${devToolsStorageKeys.base}_sync`,deviceId:()=>`${devToolsStorageKeys.sync.root()}_device_id`}};const r=["@devtools","@dev_tools_","@modal_state_","@react_query_browser_modal","@react_query_modal","@react_query_mutation_modal","@sentry_logs_modal","@floating_rn_better_dev_tools_","@floating_tools_","@apphost_","@bubble_settings_","@env_vars_modal","@storage_modal","@floating_@devtools_","dev_last_route"];export function isDevToolsStorageKey(e){if(!e)return false;for(const o of["@AsyncStorage:","CapacitorStorage."]){if(e.startsWith(o))e=e.slice(o.length)}if(e.startsWith(devToolsStorageKeys.base)){return true}if(e.startsWith("buoy-")){return true}if(e.startsWith("@buoy")){return true}if(/^(?:buoy[._]|__buoy|react-buoy)/i.test(e)){return true}for(const o of r){if(e.startsWith(o)){return true}}return false}export function filterOutDevToolsKeys(e){return e.filter(o=>!isDevToolsStorageKey(o))}export function getAllDevToolsStorageKeys(){const e=[];e.push(devToolsStorageKeys.bubble.settings());e.push(devToolsStorageKeys.bubble.userPreferences());e.push(devToolsStorageKeys.bubble.position());e.push(devToolsStorageKeys.modal.state());e.push(devToolsStorageKeys.modal.position());e.push(devToolsStorageKeys.modal.dimensions());e.push(devToolsStorageKeys.settings.theme());e.push(devToolsStorageKeys.settings.preferences());e.push(devToolsStorageKeys.env.currentEnv());e.push(devToolsStorageKeys.env.overrides());e.push(devToolsStorageKeys.sentry.filters());e.push(devToolsStorageKeys.sentry.preferences());e.push(devToolsStorageKeys.storage.filters());e.push(devToolsStorageKeys.storage.preferences());e.push(devToolsStorageKeys.reactQuery.filters());e.push(devToolsStorageKeys.reactQuery.preferences());return e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";let p=null;export function setBuoyAppId(t){p=typeof t==="string"&&t.trim()?t.trim():null}export function getBuoyAppId(){return p}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{absoluteFill}from"./absoluteFill.js";export{displayValue,parseDisplayValue}from"./displayValue.js";export{getSafeAreaInsets}from"./getSafeAreaInsets";export{persistentStorage,isUsingPersistentStorage,getStorageBackendType}from"./persistentStorage";export{safeStringify}from"./safeStringify.js";export{getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize}from"./typeHelpers.js";export{parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath}from"./valueFormatting.js";export{loadOptionalModule,getCachedOptionalModule}from"./loadOptionalModule.js";export{setRenderCaptureProvider,getRenderCaptureProvider}from"./renderCaptureRegistry.js";export{registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders}from"./stateSnapshotRegistry.js";export{serialize as superJsonSerialize,deserialize as superJsonDeserialize}from"./minimalSuperJSON.js";export{reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS}from"./reloadApp.js";export{getDevServerOrigin}from"./devServer";export{realNow}from"./realNow.js";export{getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener}from"./realAppState.js";export{Subscribable}from"./subscribable.js";export{subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange}from"./subscriberCountNotifier.js";export{useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./safeExpoRouter";export{getBrowserStorage,subscribeToBrowserStorage}from"./browserAsyncStorage.js";export{browserRouter,getBrowserHref,getBrowserRouteURL,registerBrowserRouter,subscribeBrowserNavigation}from"./browserNavigation.js";export{isDOMElement,getDOMControlProps,getDOMFiber,getDOMNodeHandle,getDOMPublicInstance,resolveDOMEventEmitter}from"./domRuntime.js";export{registerToolModules,getRegisteredToolModule,getToolModuleVersion}from"./toolModules.js";export{loadToolModule}from"./loadToolModule";
|
|
1
|
+
"use strict";export{absoluteFill}from"./absoluteFill.js";export{displayValue,parseDisplayValue}from"./displayValue.js";export{getSafeAreaInsets}from"./getSafeAreaInsets";export{persistentStorage,isUsingPersistentStorage,getStorageBackendType}from"./persistentStorage";export{safeStringify}from"./safeStringify.js";export{getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize}from"./typeHelpers.js";export{parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath}from"./valueFormatting.js";export{loadOptionalModule,getCachedOptionalModule}from"./loadOptionalModule.js";export{setRenderCaptureProvider,getRenderCaptureProvider}from"./renderCaptureRegistry.js";export{registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders}from"./stateSnapshotRegistry.js";export{serialize as superJsonSerialize,deserialize as superJsonDeserialize,dropAnnotations as superJsonDropAnnotations}from"./minimalSuperJSON.js";export{reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS}from"./reloadApp.js";export{getDevServerOrigin}from"./devServer";export{realNow}from"./realNow.js";export{getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener}from"./realAppState.js";export{Subscribable}from"./subscribable.js";export{subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange}from"./subscriberCountNotifier.js";export{useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./safeExpoRouter";export{getBrowserStorage,subscribeToBrowserStorage}from"./browserAsyncStorage.js";export{browserRouter,getBrowserHref,getBrowserRouteURL,registerBrowserRouter,subscribeBrowserNavigation}from"./browserNavigation.js";export{isDOMElement,getDOMControlProps,getDOMFiber,getDOMNodeHandle,getDOMPublicInstance,resolveDOMEventEmitter}from"./domRuntime.js";export{registerToolModules,getRegisteredToolModule,getToolModuleVersion}from"./toolModules.js";export{loadToolModule}from"./loadToolModule";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const U=n=>typeof n==="undefined";const V=n=>{if(typeof n!=="object"||n===null)return false;if(n===Object.prototype)return false;if(Object.getPrototypeOf(n)===null)return true;return Object.getPrototypeOf(n)===Object.prototype};const c=n=>Array.isArray(n);const E=n=>typeof n==="boolean"||n===null||typeof n==="undefined"||typeof n==="number"||typeof n==="string"||typeof n==="symbol";const N=n=>n instanceof Date&&!isNaN(n.valueOf());const g=n=>n instanceof Error;const S=n=>n instanceof RegExp;const d=n=>n instanceof Set;const b=n=>n instanceof Map;const D=n=>typeof n==="bigint";const O=n=>typeof n==="number"&&isNaN(n);const j=n=>n===Infinity||n===-Infinity;const B=n=>n===0&&1/n===-Infinity;const _=n=>n instanceof URL;const P=n=>ArrayBuffer.isView(n)&&!(n instanceof DataView);const v={Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray};const w=[{isApplicable:U,annotation:"undefined",transform:()=>null,untransform:()=>void 0},{isApplicable:D,annotation:"bigint",transform:n=>n.toString(),untransform:n=>{if(typeof BigInt!=="undefined"){return BigInt(n)}console.error("[Buoy]","BigInt is not supported in this environment");return n}},{isApplicable:N,annotation:"Date",transform:n=>n.toISOString(),untransform:n=>new Date(n)},{isApplicable:g,annotation:"Error",transform:n=>({name:n.name,message:n.message,stack:n.stack,cause:"cause"in n?n.cause:void 0}),untransform:n=>{const t=new Error(n.message);t.name=n.name;t.stack=n.stack;if(n.cause!==void 0){t.cause=n.cause}return t}},{isApplicable:S,annotation:"regexp",transform:n=>""+n,untransform:n=>{const t=n.slice(1,n.lastIndexOf("/"));const r=n.slice(n.lastIndexOf("/")+1);return new RegExp(t,r)}},{isApplicable:d,annotation:"set",transform:n=>[...n.values()],untransform:n=>new Set(n)},{isApplicable:b,annotation:"map",transform:n=>[...n.entries()],untransform:n=>new Map(n)},{isApplicable:n=>O(n)||j(n),annotation:"number",transform:n=>{if(O(n))return"NaN";return n>0?"Infinity":"-Infinity"},untransform:n=>Number(n)},{isApplicable:B,annotation:"number",transform:()=>"-0",untransform:()=>-0},{isApplicable:_,annotation:"URL",transform:n=>n.toString(),untransform:n=>new URL(n)},{isApplicable:P,annotation:n=>["typed-array",n.constructor.name],transform:n=>[...n],untransform:(n,t)=>{const r=Array.isArray(t)?t[1]:"Uint8Array";const e=v[r];if(!e){throw new Error(`Unknown typed array: ${r}`)}return new e(n)}}];function y(n){for(const t of w){if(t.isApplicable(n)){const r=typeof t.annotation==="function"?t.annotation(n):t.annotation;return{value:t.transform(n),type:r}}}return void 0}function h(n,t){for(const r of w){const e=typeof r.annotation==="function"?Array.isArray(t)?t[0]:t:r.annotation;const o=Array.isArray(t)&&Array.isArray(e)?t[0]===e[0]:e===t;if(o){return r.untransform(n,t)}}throw new Error(`Unknown transformation: ${t}`)}const I=n=>V(n)||c(n)||b(n)||d(n)||g(n);function A(n){return n.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function R(n,t=[],r=[]){const e=E(n);if(!e&&!I(n)){const i=y(n);return i?{transformedValue:i.value,annotations:{[t.map(String).map(A).join(".")]:i.type}}:{transformedValue:n}}if(!e&&r.indexOf(n)!==-1){return{transformedValue:null}}if(!I(n)){const i=y(n);return i?{transformedValue:i.value,annotations:t.length>0?{[t.map(String).map(A).join(".")]:i.type}:{"":i.type}}:{transformedValue:n}}const o=y(n);const s=o?.value??n;const a=c(s)?[]:{};const f={};if(o){const i=t.length>0?t.map(String).map(A).join("."):"";f[i]=o.type}const l=c(s)?s.map((i,m)=>[m,i]):Object.entries(s);for(const[i,m]of l){const u=String(i);if(u==="__proto__"||u==="constructor"||u==="prototype"){throw new Error(`Detected property ${u}. This is a prototype pollution risk, please remove it from your object.`)}const p=R(m,[...t,i],[...r,n]);a[i]=p.transformedValue;if(p.annotations){Object.assign(f,p.annotations)}}return{transformedValue:a,annotations:Object.keys(f).length>0?f:void 0}}function k(n){if(n==="")return[];const t=[];let r="";for(let e=0;e<n.length;e++){const o=n.charAt(e);if(o==="\\"){const s=n.charAt(e+1);if(s==="\\"){r+="\\";e++;continue}else if(s==="."){r+=".";e++;continue}}if(o==="."){t.push(r);r="";continue}r+=o}if(r){t.push(r)}return t}function C(n,t,r){if(t.length===0){return}let e=n;for(let o=0;o<t.length-1;o++){e=e[t[o]]}e[t[t.length-1]]=r}function x(n,t){let r=n;for(const e of t){r=r[e]}return r}export function serialize(n){const t=R(n);const r={json:t.transformedValue};if(t.annotations){r.meta={values:t.annotations}}return r}export function deserialize(n){const{json:t,meta:r}=n;if(!r?.values){return t}let e=c(t)?[...t]:{...t};const o=Object.entries(r.values).map(([s,a])=>({pathString:s,type:a,path:k(s)})).sort((s,a)=>a.path.length-s.path.length);for(const{type:s,path:a}of o){if(a.length===0){e=h(e,s)}else{const f=x(e,a);const l=h(f,s);C(e,a,l)}}return e}export function dropAnnotations(n,t){const r=n.meta?.values;if(!r)return n;const e={};for(const[o,s]of Object.entries(r)){let a;try{a=x(n.json,k(o))}catch{continue}if(!t(a))e[o]=s}return Object.keys(e).length?{json:n.json,meta:{values:e}}:{json:n.json}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export*from"react-native-web";export{unstable_createElement,NativeModules,AccessibilityInfo,
|
|
1
|
+
"use strict";export*from"react-native-web";export{unstable_createElement,NativeModules,AccessibilityInfo,Appearance,AppRegistry,AppState,BackHandler,Clipboard,Dimensions,Easing,I18nManager,Keyboard,InteractionManager,LayoutAnimation,Linking,NativeEventEmitter,PanResponder,PixelRatio,Platform,Share,UIManager,Vibration,CheckBox,FlatList,Image,ImageBackground,KeyboardAvoidingView,Picker,ProgressBar,RefreshControl,SafeAreaView,SectionList,StatusBar,Touchable,TouchableNativeFeedback,VirtualizedList,YellowBox,LogBox,DeviceEventEmitter,useColorScheme,useLocaleContext,useWindowDimensions}from"react-native-web";import*as c from"react-native-web";import{createElement as w,forwardRef as S,useCallback as E,useRef as A}from"react";import{BuoyPortal as C,getBuoyPortalHost as $}from"../ui/floating/portalHost.web.js";const h=c;const T=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"];const f=e=>typeof e==="number"?`${e}px`:e;function y(e){if(Array.isArray(e)){const d=e.map(y);return d.some((m,b)=>m!==e[b])?d:e}if(!e||typeof e!=="object"||!T.some(d=>e[d]!=null))return e;const{shadowColor:o,shadowOffset:a,shadowOpacity:l,shadowRadius:t,textShadowColor:i,textShadowOffset:u,textShadowRadius:x,...n}=e;if(o!=null||a!=null||l!=null||t!=null){const d=o??"black";const m=l==null?d:`color-mix(in srgb, ${d} ${Math.min(l,1)*100}%, transparent)`;const b=`${f(a?.width??0)} ${f(a?.height??0)} ${f(t??0)} ${m}`;n.boxShadow=typeof n.boxShadow==="string"?`${n.boxShadow}, ${b}`:n.boxShadow??b}const{width:s=0,height:r=0}=u??{};if(i&&(s||r||x)){const d=`${f(s)} ${f(r)} ${f(x??0)} ${i}`;n.textShadow=n.textShadow?`${n.textShadow}, ${d}`:d}return n}const k=h.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function g(e,o){if(typeof e==="function")return l=>g(e(l),o);const a=y(e);return o?[a,k[o]]:a}export const StyleSheet={...h.StyleSheet,create:e=>h.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([o,a])=>[o,y(a)])))};function p(e){const o=S((l,t)=>{const{accessibilityState:i,accessibilityValue:u,pointerEvents:x,...n}=l;for(const r of["busy","checked","disabled","expanded","selected"]){if(i?.[r]!==void 0&&n[`aria-${r}`]===void 0){n[`aria-${r}`]=i[r]}}for(const[r,d]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"})){if(u?.[r]!==void 0&&n[`aria-${d}`]===void 0){n[`aria-${d}`]=u[r]}}const s=g(n.style,x);if(s!==n.style)n.style=s;return w(e,{...n,ref:t})});const a=e.State;if(a)Object.assign(o,{State:a});o.displayName=e.displayName??e.name??"NativeWebView";return o}export const View=p(c.View);export const Text=p(c.Text);export const Animated={...h.Animated,View:h.Animated.createAnimatedComponent(View),Text:h.Animated.createAnimatedComponent(Text)};export const TextInput=p(c.TextInput);export const TouchableOpacity=p(c.TouchableOpacity);export const TouchableHighlight=p(c.TouchableHighlight);export const TouchableWithoutFeedback=p(c.TouchableWithoutFeedback);export const Pressable=p(c.Pressable);export const ScrollView=p(c.ScrollView);const v=S((e,o)=>{const a=A(null);const l=E(t=>{if(t){let i=t;while(i.parentElement&&i.parentElement!==document.body)i=i.parentElement;if(i.parentElement===document.body){a.current=i;Object.assign(i.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"});$().appendChild(i)}}else if(a.current){document.body.appendChild(a.current);a.current=null}if(typeof o==="function")o(t);else if(o)o.current=t},[o]);return w(C,null,w(c.Modal,{...e,ref:l}))});v.displayName="Modal";export const Modal=p(v);export const Switch=p(c.Switch);export const ActivityIndicator=p(c.ActivityIndicator);export const Button=p(c.Button);export const findNodeHandle=c.findNodeHandle;export const Alert={alert(e,o,a,l){if(typeof document==="undefined")return;const t=document.createElement("dialog");t.dataset.buoyRoot="";t.setAttribute("aria-label",e);t.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";const i=document.createElement("h2");i.textContent=e;i.style.cssText="font-size:18px;margin:0 0 12px";t.appendChild(i);if(o){const s=document.createElement("p");s.textContent=o;s.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px";t.appendChild(s)}const u=document.createElement("div");u.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";const x=a?.length?a:[{text:"OK"}];const n=()=>{t.close?.();t.remove()};for(const s of x){const r=document.createElement("button");r.type="button";r.textContent=s.text??"OK";r.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${s.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`;r.onclick=()=>{n();s.onPress?.()};u.appendChild(r)}t.addEventListener("cancel",s=>{s.preventDefault();if(l?.cancelable===false)return;n();l?.onDismiss?.()});t.appendChild(u);document.body.appendChild(t);if(t.showModal)t.showModal();else t.setAttribute("open","")}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export function loadDevSettings(){try{const
|
|
1
|
+
"use strict";function t(){const o=globalThis.expo;if(!o?.modules?.ExpoGo||typeof o.reloadAppAsync!=="function")return null;const n=o.reloadAppAsync.bind(o);return e=>{void n(e)}}export function loadDevSettings(){const o=t();if(o)return{reload:o};try{const n=require("react-native");const e=n?.DevSettings;if(e&&typeof e.reload==="function"){return e}}catch{}return null}export function loadExpoUpdates(){try{const o=require("expo-updates");if(o&&typeof o.reloadAsync==="function"){return o}}catch{}return null}export function loadBrowserReload(){return null}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ScrubRules } from "./scrub";
|
|
2
|
+
import { type BugCase } from "./types";
|
|
3
|
+
export interface BugCaseBudget {
|
|
4
|
+
networkCalls: number;
|
|
5
|
+
/** Bodies past this, summed over the case, are left out and marked. */
|
|
6
|
+
bodyBytes: number;
|
|
7
|
+
/** One call's bodies past this are left out and marked. */
|
|
8
|
+
callBodyBytes: number;
|
|
9
|
+
consoleLines: number;
|
|
10
|
+
touches: number;
|
|
11
|
+
screenElements: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_BUG_CASE_BUDGET: BugCaseBudget;
|
|
14
|
+
export interface CaptureBugCaseOptions {
|
|
15
|
+
note?: string;
|
|
16
|
+
rules?: ScrubRules;
|
|
17
|
+
budget?: Partial<BugCaseBudget>;
|
|
18
|
+
}
|
|
19
|
+
export declare function captureBugCase(options?: CaptureBugCaseOptions): Promise<BugCase>;
|
|
20
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A bug case as plain text, for a person or an AI to read: the link page's
|
|
3
|
+
* "Copy for AI", MCP's `get_bug_case`, and the phone's share sheet.
|
|
4
|
+
*
|
|
5
|
+
* A case is data from someone's app. It can hold text that looks like
|
|
6
|
+
* instructions, so the text says plainly that nothing inside it is one, and
|
|
7
|
+
* every value is quoted or fenced rather than spliced in as prose.
|
|
8
|
+
*/
|
|
9
|
+
import type { BugCase, BugCaseNetworkCall } from "./types";
|
|
10
|
+
export declare function isFailedCall(call: BugCaseNetworkCall): boolean;
|
|
11
|
+
export declare function formatBugCase(kase: BugCase, options?: {
|
|
12
|
+
link?: string;
|
|
13
|
+
maxCalls?: number;
|
|
14
|
+
}): string;
|
|
15
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { captureBugCase, DEFAULT_BUG_CASE_BUDGET } from "./capture";
|
|
2
|
+
export type { BugCaseBudget, CaptureBugCaseOptions } from "./capture";
|
|
3
|
+
export { base64UrlDecode, base64UrlEncode, BUG_CASE_LOCK_FORMAT, bugCaseHeader, BugCaseLockError, bugLinkUrl, lockBugCase, MAX_BUG_CASE_BYTES, parseBugLink, readBugCaseHeader, unlockBugCase, webCaseCrypto, } from "./lock";
|
|
4
|
+
export type { BugCaseCrypto, BugCaseHeader, BugCaseLockErrorCode, LockedBugCase } from "./lock";
|
|
5
|
+
export { bugCaseRecorderStatus, startBugCaseRecorder, stopBugCaseRecorder } from "./recorder";
|
|
6
|
+
export type { BugCaseRecorderStatus } from "./recorder";
|
|
7
|
+
export { formatBugCase, isFailedCall } from "./format";
|
|
8
|
+
export { classifyKey, keyWords, REMOVED_MARK, removedMark, ScrubLimitError, scrubBugCase } from "./scrub";
|
|
9
|
+
export type { ScrubbedItem, ScrubKind, ScrubResult, ScrubRules } from "./scrub";
|
|
10
|
+
export { bugCaseSteps, formatBugCaseSteps, safeTouch } from "./steps";
|
|
11
|
+
export type { BugCaseRouteVisit, BugCaseStep, BugCaseTouch } from "./steps";
|
|
12
|
+
export { BUG_CASE_VERSION } from "./types";
|
|
13
|
+
export type { BugCase, BugCaseConsoleLine, BugCaseMissing, BugCaseNetworkCall, BugCaseScreenElement, } from "./types";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lock and unlock a bug case.
|
|
3
|
+
*
|
|
4
|
+
* A case leaves the phone locked with AES-256-GCM under a key made for it
|
|
5
|
+
* alone. The key goes after `#` in the link, and browsers never send that part
|
|
6
|
+
* to a server, so buoy.gg stores bytes it cannot read.
|
|
7
|
+
*
|
|
8
|
+
* The blob carries everything:
|
|
9
|
+
*
|
|
10
|
+
* "BUOYBUG" | format (1 byte) | header length (u32, big-endian) | header JSON | nonce (12) | sealed
|
|
11
|
+
*
|
|
12
|
+
* `sealed` is gzip(case JSON) under the key, GCM tag at the end. Every byte
|
|
13
|
+
* before it is the additional data, so the server can read the plain header
|
|
14
|
+
* (for its list and for Slack previews) but cannot change it: a changed header
|
|
15
|
+
* fails the unlock the same way a changed case does.
|
|
16
|
+
*
|
|
17
|
+
* The header is built field by field from safe facts, never spread from the
|
|
18
|
+
* case, so nothing a person typed or the app held can end up readable.
|
|
19
|
+
*
|
|
20
|
+
* The crypto is passed in. `webCaseCrypto` uses WebCrypto and
|
|
21
|
+
* CompressionStream, which browsers and Node have. Hermes has neither, nor a
|
|
22
|
+
* secure random source, so the phone passes its own.
|
|
23
|
+
*/
|
|
24
|
+
import { type BugCase } from "./types";
|
|
25
|
+
export declare const BUG_CASE_LOCK_FORMAT = 1;
|
|
26
|
+
/** Case JSON past this is refused on lock and on unlock (a zip bomb stops here). */
|
|
27
|
+
export declare const MAX_BUG_CASE_BYTES: number;
|
|
28
|
+
/** What buoy.gg can read. Only facts that hold no user data. */
|
|
29
|
+
export interface BugCaseHeader {
|
|
30
|
+
v: typeof BUG_CASE_LOCK_FORMAT;
|
|
31
|
+
case: number;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
platform: string;
|
|
34
|
+
os: string;
|
|
35
|
+
/** Case JSON size before zipping. */
|
|
36
|
+
bytes: number;
|
|
37
|
+
steps: number;
|
|
38
|
+
calls: number;
|
|
39
|
+
errors: number;
|
|
40
|
+
removed: number;
|
|
41
|
+
missing: number;
|
|
42
|
+
}
|
|
43
|
+
export interface LockedBugCase {
|
|
44
|
+
blob: Uint8Array;
|
|
45
|
+
/** base64url, for the part of the link after `#`. */
|
|
46
|
+
key: string;
|
|
47
|
+
header: BugCaseHeader;
|
|
48
|
+
}
|
|
49
|
+
export interface BugCaseCrypto {
|
|
50
|
+
randomBytes(length: number): Uint8Array;
|
|
51
|
+
/** AES-256-GCM; returns ciphertext with the 16-byte tag appended. */
|
|
52
|
+
seal(key: Uint8Array, nonce: Uint8Array, data: Uint8Array, aad: Uint8Array): Promise<Uint8Array>;
|
|
53
|
+
/** Throws when the key is wrong or a byte changed. */
|
|
54
|
+
open(key: Uint8Array, nonce: Uint8Array, sealed: Uint8Array, aad: Uint8Array): Promise<Uint8Array>;
|
|
55
|
+
gzip(data: Uint8Array): Promise<Uint8Array>;
|
|
56
|
+
/** Throws BugCaseLockError("too_big") once the output passes maxBytes. */
|
|
57
|
+
gunzip(data: Uint8Array, maxBytes: number): Promise<Uint8Array>;
|
|
58
|
+
}
|
|
59
|
+
export type BugCaseLockErrorCode =
|
|
60
|
+
/** No secure random source or no cipher on this platform. */
|
|
61
|
+
"no_crypto"
|
|
62
|
+
/** The key in the link is not a key. */
|
|
63
|
+
| "bad_link"
|
|
64
|
+
/** Not a bug case blob, or a blob from a newer Buoy. */
|
|
65
|
+
| "bad_blob"
|
|
66
|
+
/** Wrong key, or the blob was changed. GCM can't say which. */
|
|
67
|
+
| "locked" | "too_big";
|
|
68
|
+
export declare class BugCaseLockError extends Error {
|
|
69
|
+
readonly code: BugCaseLockErrorCode;
|
|
70
|
+
constructor(code: BugCaseLockErrorCode, message: string);
|
|
71
|
+
}
|
|
72
|
+
export declare function bugCaseHeader(kase: BugCase, bytes: number): BugCaseHeader;
|
|
73
|
+
/**
|
|
74
|
+
* `options.key` locks under an existing link's key (with a fresh nonce), so a
|
|
75
|
+
* case can be replaced, say to add a note, and the link people already have
|
|
76
|
+
* keeps working.
|
|
77
|
+
*/
|
|
78
|
+
export declare function lockBugCase(kase: BugCase, crypto?: BugCaseCrypto, options?: {
|
|
79
|
+
key?: string;
|
|
80
|
+
}): Promise<LockedBugCase>;
|
|
81
|
+
/** For the server: the plain header, read without the key. */
|
|
82
|
+
export declare function readBugCaseHeader(blob: Uint8Array): BugCaseHeader;
|
|
83
|
+
export declare function unlockBugCase(blob: Uint8Array, key: string, options?: {
|
|
84
|
+
crypto?: BugCaseCrypto;
|
|
85
|
+
maxBytes?: number;
|
|
86
|
+
}): Promise<{
|
|
87
|
+
header: BugCaseHeader;
|
|
88
|
+
kase: BugCase;
|
|
89
|
+
}>;
|
|
90
|
+
export declare function bugLinkUrl(origin: string, id: string, key: string): string;
|
|
91
|
+
export declare function parseBugLink(link: string): {
|
|
92
|
+
id: string;
|
|
93
|
+
key: string;
|
|
94
|
+
} | null;
|
|
95
|
+
/** WebCrypto and CompressionStream: browsers, Node 18+, Workers. Not Hermes. */
|
|
96
|
+
export declare function webCaseCrypto(): BugCaseCrypto;
|
|
97
|
+
export declare function base64UrlEncode(bytes: Uint8Array): string;
|
|
98
|
+
export declare function base64UrlDecode(text: string): Uint8Array | null;
|
|
99
|
+
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface BugCaseRecorderStatus {
|
|
2
|
+
watching: string[];
|
|
3
|
+
touches: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function startBugCaseRecorder(): Promise<BugCaseRecorderStatus>;
|
|
6
|
+
export declare function stopBugCaseRecorder(): void;
|
|
7
|
+
export declare function bugCaseRecorderStatus(): BugCaseRecorderStatus;
|
|
8
|
+
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scrubBugCase — take secrets and personal data out of a bug case on the
|
|
3
|
+
* device, before any of it leaves.
|
|
4
|
+
*
|
|
5
|
+
* This is the winner of the scrub lab (research/bug-links-2026-10, Lab 1,
|
|
6
|
+
* "S14"): 0 of 36 planted secrets leaked, and 1 of 55 values a repro needs
|
|
7
|
+
* was lost. What decided it, in the order it mattered:
|
|
8
|
+
*
|
|
9
|
+
* KEYS ARE JUDGED BY WHOLE WORDS. `author` is not `auth`, `pin_attempts`
|
|
10
|
+
* is not a PIN, and `nextToken` is a page cursor. Substring lists failed
|
|
11
|
+
* both ways (18 secrets leaked, 4 repro values broken).
|
|
12
|
+
*
|
|
13
|
+
* A SECRET SEEN ONCE IS A SECRET EVERYWHERE. A token found in an
|
|
14
|
+
* Authorization header or under `password` is "learned", and a second pass
|
|
15
|
+
* removes that exact value wherever else it sits: under `v`, `p` or
|
|
16
|
+
* `@app/cache:a1`. This was the largest single gain.
|
|
17
|
+
*
|
|
18
|
+
* `{key, value}` LISTS ARE JUDGED BY THEIR KEY. MMKV storage arrives as
|
|
19
|
+
* `[{key: "auth.token", value: "..."}]`; judged by the word "value" every
|
|
20
|
+
* secret in it leaked. Found on the sim, not in the first corpus.
|
|
21
|
+
*
|
|
22
|
+
* NO "LOOKS RANDOM" RULE. Entropy caught nothing the rules above missed and
|
|
23
|
+
* broke order ids, hashes and commit SHAs. It was dropped on the evidence.
|
|
24
|
+
*
|
|
25
|
+
* Removed values become `[removed:secret]` / `[removed:pii]` so the loader can
|
|
26
|
+
* graft the teammate's own value back into the same spot (see graft.ts).
|
|
27
|
+
*
|
|
28
|
+
* Pure and synchronous so it can be argued with in a unit test. Callers on a
|
|
29
|
+
* phone run it after the capture has been shown as done, off the tap.
|
|
30
|
+
*/
|
|
31
|
+
export type ScrubKind = "secret" | "pii";
|
|
32
|
+
export interface ScrubRules {
|
|
33
|
+
/** Paths or key names to always remove, e.g. "transfer.memo" or "memo". */
|
|
34
|
+
redact?: readonly string[];
|
|
35
|
+
/** Key names to always keep, even if a rule would remove them. */
|
|
36
|
+
keep?: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
export interface ScrubbedItem {
|
|
39
|
+
path: string;
|
|
40
|
+
kind: ScrubKind;
|
|
41
|
+
/** Which rule fired: "key", "value", "header", "param", "learned", "app". */
|
|
42
|
+
rule: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ScrubResult<T> {
|
|
45
|
+
value: T;
|
|
46
|
+
removed: ScrubbedItem[];
|
|
47
|
+
}
|
|
48
|
+
export declare const removedMark: (kind: ScrubKind) => string;
|
|
49
|
+
export declare const REMOVED_MARK: RegExp;
|
|
50
|
+
/** Thrown when a capture is too deep or too big to scrub. Send nothing. */
|
|
51
|
+
export declare class ScrubLimitError extends Error {
|
|
52
|
+
}
|
|
53
|
+
/** camelCase / snake_case / kebab-case / dotted keys -> lowercase words. */
|
|
54
|
+
export declare function keyWords(key: string): string[];
|
|
55
|
+
export declare function classifyKey(key: string): ScrubKind | null;
|
|
56
|
+
/** Own-property write, so a "__proto__" key in captured data can't reach a prototype. */
|
|
57
|
+
export declare function setOwn(o: Record<string, unknown>, k: string, v: unknown): void;
|
|
58
|
+
export declare function scrubBugCase<T>(input: T, rules?: ScrubRules): ScrubResult<T>;
|
|
59
|
+
//# sourceMappingURL=scrub.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bugCaseSteps — the steps to repeat a bug, written from the taps Buoy saw.
|
|
3
|
+
*
|
|
4
|
+
* No AI. In the bug-links lab (Lab 3) a model handed only the reporter's note
|
|
5
|
+
* wrote zero correct steps; handed these lines it wrote all six, and the
|
|
6
|
+
* folded repeat ("Tapped Apply SAVE10 2 times (368 ms apart)") was the cause
|
|
7
|
+
* of the double-coupon bug, written for free.
|
|
8
|
+
*
|
|
9
|
+
* Typed text never appears. A step says how many characters went into which
|
|
10
|
+
* field, because a field the capture can't see into may be a password.
|
|
11
|
+
*/
|
|
12
|
+
/** One interaction, in the shape highlight-updates' touch capture records. */
|
|
13
|
+
export interface BugCaseTouch {
|
|
14
|
+
/** Capture order. Wins over `t`, which moves when the app clock is faked. */
|
|
15
|
+
seq?: number;
|
|
16
|
+
t: number;
|
|
17
|
+
kind: "press" | "longPress" | "text" | "toggle" | "slider";
|
|
18
|
+
target: {
|
|
19
|
+
name: string;
|
|
20
|
+
testID?: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
text?: string;
|
|
23
|
+
control?: string;
|
|
24
|
+
value?: unknown;
|
|
25
|
+
};
|
|
26
|
+
value?: unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface BugCaseRouteVisit {
|
|
29
|
+
t: number;
|
|
30
|
+
pathname: string;
|
|
31
|
+
}
|
|
32
|
+
export interface BugCaseStep {
|
|
33
|
+
t: number;
|
|
34
|
+
text: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Drop what a case must never carry: the text a field held or received.
|
|
38
|
+
* Toggle and slider values stay; they are what the step is about.
|
|
39
|
+
*/
|
|
40
|
+
export declare function safeTouch(touch: BugCaseTouch): BugCaseTouch;
|
|
41
|
+
export declare function bugCaseSteps(touches: readonly BugCaseTouch[], routes?: readonly BugCaseRouteVisit[]): BugCaseStep[];
|
|
42
|
+
/** Numbered lines, the form a person or a model reads. */
|
|
43
|
+
export declare function formatBugCaseSteps(steps: readonly BugCaseStep[]): string;
|
|
44
|
+
//# sourceMappingURL=steps.d.ts.map
|