PageSourceSearch

https://cloudmysite.ai/assets/usePromptEnhancer-5VnOEynm.js

js cloudmysite.ai collected 2026-10-05 15:12:02 UTC 1,483 bytes, 1 lines download raw bytes

1import{r as u}from"./jsx-runtime-C2UBfbyc.js";import{c as w}from"./logger-AqfA_hXV.js";const S=/^\s*(?:[-*]|\d+[.)]|#{1,6})\s+\S/gm,b=["accessibility","architecture","authentication","constraints","deployment","implementation","monitoring","performance","requirements","responsive","roadmap","safety","scalability","security","testing","technology stack"];function C(e){const t=e.replace(/\s+/g," ").trim();if(!t)return!1;const r=t.split(" ").filter(Boolean).length,o=(e.match(S)||[]).length,i=(e.match(/[.!?](?:\s|$)/g)||[]).length,m=t.toLowerCase(),s=b.filter(n=>m.includes(n)).length;return r>=100||t.length>=750||r>=60&&o>=3||r>=45&&i>=3&&s>=5}function R(e){return e.trim().length>0&&!C(e)}const f=w("usePromptEnhancement");function _(){const[e,t]=u.useState(!1),[r,o]=u.useState(!1);return{enhancingPrompt:e,promptEnhanced:r,enhancePrompt:async(s,n,p,g,l)=>{if(!R(s))return;t(!0),o(!1);const h={message:s,model:p,provider:g};l&&(h.apiKeys=l);const E=s;let c="";try{const a=await fetch("/api/enhancer",{method:"POST",body:JSON.stringify(h)});if(!a.ok)throw new Error(`Prompt enhancement failed with status ${a.status}`);const d=a.body?.getReader();if(!d)throw new Error("Prompt enhancement returned no response body");const P=new TextDecoder;for(n("");;){const{value:y,done:T}=await d.read();if(T)break;c+=P.decode(y),f.trace("Set input",c),n(c)}o(!0),setTimeout(()=>{n(c)})}catch(a){f.error(a),n(E)}finally{t(!1)}},resetEnhancer:()=>{t(!1),o(!1)}}}export{C as i,R as s,_ as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.