Files
cursor2api/jscode/main.js
小海 a9ada0473f fix: 优化提示词注入策略 + 稳定性提升
- 使用 few-shot in-context learning 替代 system prompt 覆盖
- 过滤工具:94个 → 核心13个(降低上下文大小)
- 添加 AbortController 超时(120s)
- 模型列表从配置动态读取
2026-03-04 15:33:25 +08:00

96 lines
6.1 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
global.cursor_config = {
currentScriptSrc: "$$currentScriptSrc$$",
fp:{
UNMASKED_VENDOR_WEBGL:"$$UNMASKED_VENDOR_WEBGL$$",
UNMASKED_RENDERER_WEBGL:"$$UNMASKED_RENDERER_WEBGL$$",
userAgent: "$$userAgent$$"
}
}
$$env_jscode$$
let console_log = console.log;
console.log = function () {
}
dtavm = console;
delete __dirname;
delete __filename;
function proxy(obj, objname, type) {
function getMethodHandler(WatchName, target_obj) {
let methodhandler = {
apply(target, thisArg, argArray) {
if (this.target_obj) {
thisArg = this.target_obj
}
let result = Reflect.apply(target, thisArg, argArray)
return result
},
construct(target, argArray, newTarget) {
var result = Reflect.construct(target, argArray, newTarget)
return result;
}
}
methodhandler.target_obj = target_obj
return methodhandler
}
function getObjhandler(WatchName) {
let handler = {
get(target, propKey, receiver) {
let result = target[propKey]
if (result instanceof Object) {
if (typeof result === "function") {
return new Proxy(result, getMethodHandler(WatchName, target))
}
return new Proxy(result, getObjhandler(`${WatchName}.${propKey}`))
}
return result;
},
set(target, propKey, value, receiver) {
return Reflect.set(target, propKey, value, receiver);
},
has(target, propKey) {
var result = Reflect.has(target, propKey);
return result;
},
deleteProperty(target, propKey) {
var result = Reflect.deleteProperty(target, propKey);
return result;
},
defineProperty(target, propKey, attributes) {
var result = Reflect.defineProperty(target, propKey, attributes);
return result
},
getPrototypeOf(target) {
var result = Reflect.getPrototypeOf(target)
return result;
},
setPrototypeOf(target, proto) {
return Reflect.setPrototypeOf(target, proto);
},
preventExtensions(target) {
return Reflect.preventExtensions(target);
},
isExtensible(target) {
var result = Reflect.isExtensible(target)
return result;
},
}
return handler;
}
if (type === "method") {
return new Proxy(obj, getMethodHandler(objname, obj));
}
return new Proxy(obj, getObjhandler(objname));
}
global.document = window.document;
$$cursor_jscode$$
window.V_C[0]().then(value => console_log(JSON.stringify(value)));