grix-connector 1.1.1 → 1.1.3
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,2 +1,3 @@
|
|
|
1
|
-
import{execFile as
|
|
2
|
-
`)[0]?.trim()||null}}catch{return{found:!1,version:null}}}async function
|
|
1
|
+
import{execFile as p}from"node:child_process";import{join as u}from"node:path";import{promisify as v}from"node:util";const a=v(p),l=5e3;function m(e){const t=e.replace(/^[^0-9]*/,"").split(".");return[parseInt(t[0]??"0",10)||0,parseInt(t[1]??"0",10)||0]}function h(e,n){const[t,r]=m(e),[i,s]=m(n);return t>i||t===i&&r>=s}async function o(e,n=["--version"]){try{const{stdout:t}=await a(e,n,{timeout:l,encoding:"utf-8"});return{found:!0,version:(t||"").trim().split(`
|
|
2
|
+
`)[0]?.trim()||null}}catch{return{found:!1,version:null}}}async function w(){const e=await o("node",["--version"]);return e.version?{found:!0,version:e.version.replace(/^v/,"")}:e}async function b(){if(process.platform==="win32"){const e=["npm",u(process.env.ProgramFiles||"C:\\Program Files","nodejs","npm.cmd"),u(process.env.APPDATA||"","npm","npm.cmd")];try{const{stdout:n}=await a("where.exe",["node"],{timeout:l,encoding:"utf-8"}),t=u(n.trim().split(`
|
|
3
|
+
`)[0],"..");e.push(u(t,"npm.cmd"))}catch{}for(const n of e)try{const{stdout:t}=await a(n,["--version"],{timeout:l,encoding:"utf-8"});return{found:!0,version:t.trim()}}catch{}return{found:!1,version:null}}return o("npm",["--version"])}async function y(){const e=await o("curl",["--version"]);return e.version?{found:!0,version:e.version.split(" ")[0]?.trim()??null}:e}async function g(){const e=await o("gh",["--version"]);return e.version?{found:!0,version:e.version.match(/(\d+\.\d+\.\d+)/)?.[1]??e.version}:e}async function P(){const e=await o("brew",["--version"]);return e.version?{found:!0,version:e.version.match(/(\d+\.\d+\.\d+)/)?.[1]??e.version}:e}function V(e){return[{id:"node",label:"Node.js",minVersion:"18.0",detect:w},{id:"npm",label:"npm",minVersion:"9.0",detect:b},{id:"curl",label:"curl",minVersion:null,detect:y},{id:"gh",label:"GitHub CLI (gh)",minVersion:null,detect:g},...e!=="windows"?[{id:"brew",label:"Homebrew",minVersion:null,detect:P}]:[]]}async function k(e,n){const r=V(n).find(d=>d.id===e);if(!r)return{id:e,label:e,met:!1,version:null,minVersion:null,autoInstallable:!1};const{found:i,version:s}=await r.detect();let c=i;c&&r.minVersion&&s&&(c=h(s,r.minVersion));const f=I(e,n);return{id:e,label:r.label,met:c,version:s,minVersion:r.minVersion,autoInstallable:c?!1:f}}async function M(e,n){return await Promise.all(e.map(r=>k(r,n)))}function A(e){return e.every(n=>n.met)}function q(e){return e.filter(n=>!n.met)}function I(e,n){switch(e){case"node":case"npm":return!0;case"curl":return!0;case"gh":return!0;case"brew":return n==="macos";default:return!1}}export{A as allPrerequisitesMet,k as checkPrerequisite,M as checkPrerequisites,q as getMissingPrerequisites};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grix-connector",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
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",
|