grix-connector 3.1.10 → 3.1.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{log as
|
|
1
|
+
import{log as s}from"../log/logger.js";import{resolveClientVersion as p}from"../util/client-version.js";let o=null,a=!1;const E="https://e8e202d7625372b1314b3ff4e85a7ff9@o119262.ingest.us.sentry.io/4511410543329280";function g(){if(!process.env.GRIX_SENTRY_DISABLE)return process.env.SENTRY_DSN||process.env.GRIX_SENTRY_DSN||E}async function I(){const e=g();if(!e){s.info("sentry","Sentry \u9519\u8BEF\u4E0A\u62A5\u5DF2\u7981\u7528\uFF08GRIX_SENTRY_DISABLE\uFF09");return}try{o=await import("@sentry/node")}catch(n){s.warn("sentry",`Sentry \u6A21\u5757\u52A0\u8F7D\u5931\u8D25\uFF08\u5E73\u53F0\u4E0D\u517C\u5BB9\uFF09\uFF0C\u9519\u8BEF\u4E0A\u62A5\u5DF2\u7981\u7528: ${n instanceof Error?n.message:String(n)}`);return}try{o.init({dsn:e,release:`grix-connector@${p()}`,environment:process.env.SENTRY_ENVIRONMENT||process.env.NODE_ENV||"production",sendDefaultPii:!1,initialScope:{tags:{component:"grix-connector"}},defaultIntegrations:!1,tracesSampleRate:0}),a=!0,s.info("sentry","Sentry \u9519\u8BEF\u4E0A\u62A5\u5DF2\u542F\u7528")}catch(n){s.error("sentry",`Sentry \u521D\u59CB\u5316\u5931\u8D25: ${n instanceof Error?n.message:String(n)}`)}}function R(){return a}const S=new Set(["INSTALL_FAILED","INSTALL_TIMEOUT","FALLBACK_EXHAUSTED","PREREQ_INSTALL_FAILED","VERIFICATION_FAILED","ENVIRONMENT_UNSUPPORTED","INTERNAL"]);function l(e){if(e.ok)return!1;const n=e.error?.code;return!!n&&S.has(n)}function m(e){if(!a||!o||!l(e))return;const n=e.error?.code??"INTERNAL",i=e.error?.message??"unknown install failure",t=e.environment;try{o.withScope(r=>{r.setLevel("error"),r.setTags({agent_type:e.agentType,error_code:n,phase:e.phase}),r.setContext("install",{agentType:e.agentType,code:n,phase:e.phase,durationMs:e.durationMs,os:t?.platform,osVersion:t?.osVersion,arch:t?.arch,nodeVersion:t?.nodeVersion,npmVersion:t?.npmVersion,isDocker:t?.isDocker,isCI:t?.isCI,outputTail:(e.output??"").slice(-2e3)}),r.setFingerprint(["agent-install-failure",e.agentType,n]),o.captureException(new Error(`Agent install failed [${e.agentType}/${n}]: ${i}`))}),s.info("sentry",`\u5DF2\u4E0A\u62A5\u5B89\u88C5\u5931\u8D25: ${e.agentType}/${n}`)}catch(r){s.error("sentry",`\u4E0A\u62A5\u5B89\u88C5\u5931\u8D25\u65F6\u51FA\u9519: ${r instanceof Error?r.message:String(r)}`)}}const y=[/No config files found/];function N(e){const n=e instanceof Error?e.message:String(e);return y.some(i=>i.test(n))}const c=new Set;function _(e,n){if(!a||!o||N(e))return;const i=e instanceof Error?e.message:String(e),t=`${n}:${i}`;if(!c.has(t)){c.add(t);try{o.withScope(r=>{r.setLevel("fatal"),r.setTag("crash_type",n);const f=e instanceof Error?e:new Error(String(e));o.captureException(f)}),s.info("sentry",`\u5DF2\u4E0A\u62A5\u5D29\u6E83: ${n}`)}catch(r){s.error("sentry",`\u4E0A\u62A5\u5D29\u6E83\u65F6\u51FA\u9519: ${r instanceof Error?r.message:String(r)}`)}}}async function d(e=2e3){if(!(!a||!o))try{await o.close(e)}catch{}}export{d as closeSentry,I as initSentry,N as isNonReportable,R as isSentryEnabled,_ as reportFatal,m as reportInstallFailure,l as shouldReportInstallFailure};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a(
|
|
1
|
+
function a(o){const e=new Set([`http://127.0.0.1:${o.serverPort}`,`http://localhost:${o.serverPort}`,...o.allowedOrigins]),t=new Set([`127.0.0.1:${o.serverPort}`,`localhost:${o.serverPort}`,...o.allowedHosts]);return{validateRequest(s){const r=i(s,e);if(!r.ok)return r;const n=l(s,t);return n.ok?{ok:!0}:n}}}function i(o,e){const t=o.headers.origin;return t?e.has(t)?{ok:!0}:{ok:!1,statusCode:403,message:`Origin not allowed: ${t}`}:{ok:!0}}function l(o,e){const t=o.headers.host;return t?e.has(t)?{ok:!0}:{ok:!1,statusCode:403,message:`Host not allowed: ${t}`}:{ok:!1,statusCode:403,message:"Missing Host header"}}export{a as createSecurityPolicy};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grix-connector",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.12",
|
|
4
4
|
"description": "Connect local AI coding agents (Claude, Codex, Gemini, Qwen, DeepSeek, Cursor, OpenCode, Pi, OpenHuman, Reasonix) to the Grix scheduling platform. Also serves as an OpenClaw plugin for Grix channel transport.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|