UNPKG

grix-connector

Version:

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.

2 lines (1 loc) 817 B
import o from"node:path";import{mkdir as c,rm as l}from"node:fs/promises";import{readJSONFile as n,writeJSONFileAtomic as s}from"../core/util/json-file.js";function r(t){return String(t??"").trim()}function a(t={}){return{schema_version:1,platform:r(t.platform),service_id:r(t.service_id),node_path:r(t.node_path),cli_path:r(t.cli_path),cli_hash:r(t.cli_hash),definition_path:r(t.definition_path),config_dir:r(t.config_dir),installed_at:Number(t.installed_at??0),updated_at:Number(t.updated_at??0)}}class m{filePath;constructor(e){this.filePath=e}async load(){const e=n(this.filePath);return!e||typeof e!="object"?null:a(e)}async save(e){const i=a(e);return await c(o.dirname(this.filePath),{recursive:!0}),await s(this.filePath,i),i}async clear(){await l(this.filePath,{force:!0})}}export{m as ServiceInstallStore};