genosdb 0.8.3 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit.min.js +10 -0
- package/dist/audit.min.js.gz +0 -0
- package/dist/gdb.min.js +1 -1
- package/dist/gdb.min.js.gz +0 -0
- package/dist/index.js +1 -1
- package/dist/index.js.gz +0 -0
- package/dist/invertedIndex.min.js +1 -1
- package/dist/invertedIndex.min.js.gz +0 -0
- package/dist/radixIndex.min.js +1 -1
- package/dist/radixIndex.min.js.gz +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
async function B($){try{const w=await fetch("https://text.pollinations.ai/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"system",content:"You are an assistant specialized in analyzing Oplog data."},{role:"user",content:$}],model:"openai",seed:Math.floor(Math.random()*1000),jsonMode:!0})});if(!w.ok)throw new Error(`Pollinations API error: ${w.statusText}`);const x=await w.json();try{return typeof x==="string"?JSON.parse(x):x}catch{return x}}catch(S){throw console.error("Error processing prompt with API:",S.message),S}}function F($,S,w={}){console.log("\uD83E\uDDE0 AI Audit module loaded."),console.log(`\uD83E\uDDE0 AI Audit Prompt: \x1B[32m${w.prompt}\x1B[0m`);const{unsubscribe:x}=$.map?.(()=>{E($,w.prompt)})??{unsubscribe:()=>{}};return{stop:()=>x?.()}}var z=($,S=500)=>{let w;return(...x)=>{clearTimeout(w),w=setTimeout(()=>$(...x),S)}},C=async($,S="detect offensive or inappropriate language, spam [find closely spaced timestamps] or prohibited content")=>{const w=$.oplog.getDelta(null),x=[];for(let j of w)try{const{result:h}=await $.get(j.id);if(h&&h.value)x.push({id:j.id,timestamp:j.timestamp,type:j.type,value:h.value})}catch(h){}const v=`
|
|
2
|
+
You are an assistant specialized in analyzing and auditing data records. Your role is to help the user identify patterns and act on prompts:
|
|
3
|
+
|
|
4
|
+
Rules:
|
|
5
|
+
- Generate ONLY a valid JSON object whose identifiers have been proposed.
|
|
6
|
+
|
|
7
|
+
Prompt: "${S}"
|
|
8
|
+
Elements to analyze: "${JSON.stringify(x)}" (only upserted nodes)
|
|
9
|
+
Output found list example: list:{["id": xx], ["id": xx]} or list:{}
|
|
10
|
+
`,k=await B(v);if(k.list&&Array.isArray(k.list))for(let j of k.list){const h=j.id??j;$.remove?.(h),$.oplog?.remove?.(h),console.log(`\uD83D\uDEE1\uFE0F Audit: Node deleted by audit \u2192 ${h}`)}},E=z(C,500);export{F as init,z as debounce};
|
|
Binary file
|